| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #include "core/ConfigVar.h"
- #include "core/DebugDraw.h"
- #include "core/EntityPoint.h"
- #include "core/ScriptManager.h"
- ConfigVar cv_debug_point("debug_point", "Draw point debug info", "false");
- EntityPoint::EntityPoint(const Ogre::String& name):
- name_(name),
- position_(Ogre::Vector3::ZERO),
- rotation_(0)
- {
- }
- EntityPoint::~EntityPoint()
- {
- }
- void
- EntityPoint::UpdateDebug()
- {
- if(cv_debug_point.GetB() == true)
- {
- DEBUG_DRAW.SetColour(Ogre::ColourValue::White);
- Ogre::Vector3 point1 = position_;
- point1.z += 0.5f;
- Ogre::Vector3 point2 = position_;
- point2.z -= 0.5f;
- DEBUG_DRAW.Line3d(point1, point2);
- DEBUG_DRAW.SetTextAlignment(DEBUG_DRAW.CENTER);
- DEBUG_DRAW.SetFadeDistance(30, 40);
- DEBUG_DRAW.Text(position_, 0, 0, name_);
- }
- }
- const Ogre::String&
- EntityPoint::GetName() const
- {
- return name_;
- }
- void
- EntityPoint::SetPosition(const Ogre::Vector3& point)
- {
- position_ = point;
- }
- const Ogre::Vector3&
- EntityPoint::GetPosition() const
- {
- return position_;
- }
- std::tuple<float, float, float>
- EntityPoint::ScriptGetPosition() const
- {
- return std::make_tuple(position_.x, position_.y, position_.z);
- }
- void
- EntityPoint::SetRotation(const float rotation)
- {
- rotation_ = rotation;
- }
- float
- EntityPoint::GetRotation() const
- {
- return rotation_;
- }
- float
- EntityPoint::ScriptGetRotation() const
- {
- return rotation_;
- }
|