Blender V2.61 - r43446
|
#include <SG_Spatial.h>
SG_Spatial contains spatial information (local & world position, rotation and scaling) for a Scene graph node. It also contains a link to the node's parent.
Definition at line 51 of file SG_Spatial.h.
SG_Spatial::SG_Spatial | ( | void * | clientobj, |
void * | clientinfo, | ||
SG_Callbacks & | callbacks | ||
) | [protected] |
Protected constructor this class is not designed for direct instantiation
Definition at line 39 of file SG_Spatial.cpp.
SG_Spatial::SG_Spatial | ( | const SG_Spatial & | other | ) | [protected] |
Definition at line 64 of file SG_Spatial.cpp.
References m_parent_relation, and SG_ParentRelation::NewCopy().
SG_Spatial::~SG_Spatial | ( | ) | [protected, virtual] |
Definition at line 88 of file SG_Spatial.cpp.
References m_parent_relation.
SG_BBox& SG_Spatial::BBox | ( | ) | [inline] |
Bounding box functions.
Definition at line 231 of file SG_Spatial.h.
References m_bbox.
Referenced by KX_Scene::AddReplicaObject(), BL_ConvertBlenderObjects(), KX_Scene::DupliGroupRecurse(), SG_Tree::Find(), and SG_Tree::SG_Tree().
void SG_Spatial::ClearDirty | ( | ) | [inline] |
Definition at line 81 of file SG_Spatial.h.
References m_ogldirty.
Referenced by KX_GameObject::GetOpenGLMatrix().
void SG_Spatial::ClearModified | ( | ) | [inline] |
Definition at line 71 of file SG_Spatial.h.
References m_modified, and m_ogldirty.
Referenced by KX_BoneParentRelation::UpdateChildCoordinates(), KX_SlowParentRelation::UpdateChildCoordinates(), KX_VertexParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
bool SG_Spatial::ComputeWorldTransforms | ( | const SG_Spatial * | parent, |
bool & | parentUpdated | ||
) | [inline] |
Definition at line 222 of file SG_Spatial.h.
References m_parent_relation, and SG_ParentRelation::UpdateChildCoordinates().
Referenced by UpdateSpatialData().
void SG_Spatial::getAABBox | ( | MT_Point3 * | box | ) | const |
Definition at line 211 of file SG_Spatial.cpp.
References SG_BBox::getaa(), GetWorldTransform(), and m_bbox.
void SG_Spatial::getBBox | ( | MT_Point3 * | box | ) | const |
Definition at line 206 of file SG_Spatial.cpp.
References SG_BBox::get(), GetWorldTransform(), and m_bbox.
Referenced by KX_Scene::MarkVisible().
const MT_Matrix3x3& SG_Spatial::GetLocalOrientation | ( | ) | const [inline] |
Definition at line 186 of file SG_Spatial.h.
References m_localRotation.
Referenced by KX_Scene::AddNodeReplicaObject(), KX_SteeringActuator::KX_SteeringActuator(), KX_TrackToActuator::KX_TrackToActuator(), KX_GameObject::NodeGetLocalOrientation(), KX_Dome::RenderDomeFrame(), KX_Dome::RotateCamera(), KX_IpoSGController::Update(), KX_BoneParentRelation::UpdateChildCoordinates(), KX_SlowParentRelation::UpdateChildCoordinates(), KX_VertexParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
const MT_Point3& SG_Spatial::GetLocalPosition | ( | ) | const [inline] |
Definition at line 181 of file SG_Spatial.h.
References m_localPosition.
Referenced by KX_Scene::AddNodeReplicaObject(), KX_GameObject::NodeGetLocalPosition(), KX_IpoSGController::Update(), KX_ConstraintActuator::Update(), KX_TrackToActuator::Update(), KX_BoneParentRelation::UpdateChildCoordinates(), KX_SlowParentRelation::UpdateChildCoordinates(), KX_VertexParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
const MT_Vector3& SG_Spatial::GetLocalScale | ( | ) | const [inline] |
Definition at line 191 of file SG_Spatial.h.
References m_localScaling.
Referenced by KX_Scene::AddNodeReplicaObject(), KX_Scene::AddReplicaObject(), GPC_RenderTools::applyTransform(), KX_BlenderRenderTools::applyTransform(), KX_GameObject::NodeGetLocalScaling(), KX_GameObject::NodeSetRelativeScale(), KX_IpoSGController::Update(), KX_BoneParentRelation::UpdateChildCoordinates(), KX_SlowParentRelation::UpdateChildCoordinates(), KX_VertexParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
SG_ParentRelation* SG_Spatial::GetParentRelation | ( | ) | [inline] |
Definition at line 104 of file SG_Spatial.h.
References m_parent_relation.
const MT_Matrix3x3& SG_Spatial::GetWorldOrientation | ( | ) | const [inline] |
Definition at line 201 of file SG_Spatial.h.
References m_worldRotation.
Referenced by KX_GameObject::AlignAxisToVect(), KX_GameObject::GetAngularVelocity(), KX_GameObject::GetLinearVelocity(), KX_MotionState::getWorldOrientation(), KX_GameObject::NodeGetWorldOrientation(), KX_GameObject::NodeSetWorldPosition(), RelativeRotate(), RelativeTranslate(), ImageRender::Render(), KX_IpoSGController::Update(), KX_SlowParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
const MT_Point3& SG_Spatial::GetWorldPosition | ( | ) | const [inline] |
Definition at line 196 of file SG_Spatial.h.
References m_worldPosition.
Referenced by KX_MotionState::getWorldPosition(), KX_GameObject::NodeGetWorldPosition(), KX_GameObject::NodeSetWorldPosition(), KX_GameObject::RemoveParent(), ImageRender::Render(), KX_SlowParentRelation::UpdateChildCoordinates(), KX_VertexParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
const MT_Vector3& SG_Spatial::GetWorldScaling | ( | ) | const [inline] |
Definition at line 206 of file SG_Spatial.h.
References m_worldScaling.
Referenced by KX_GameObject::GetOpenGLMatrix(), KX_MotionState::getWorldScaling(), KX_Scene::MarkVisible(), KX_GameObject::NodeGetWorldScaling(), KX_GameObject::NodeSetWorldPosition(), ImageRender::Render(), KX_SlowParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
MT_Transform SG_Spatial::GetWorldTransform | ( | ) | const |
Definition at line 191 of file SG_Spatial.cpp.
References m_worldPosition, m_worldRotation, and m_worldScaling.
Referenced by getAABBox(), getBBox(), inside(), SG_Tree::SG_Tree(), and KX_BoneParentRelation::UpdateChildCoordinates().
bool SG_Spatial::inside | ( | const MT_Point3 & | point | ) | const |
Definition at line 198 of file SG_Spatial.cpp.
References MT_Vector3::closestAxis(), MT_Point3::distance2(), GetWorldTransform(), SG_BBox::inside(), m_bbox, m_radius, m_worldPosition, m_worldScaling, and SG_BBox::transform().
Referenced by KX_Scene::MarkVisible().
bool SG_Spatial::IsDirty | ( | ) | [inline] |
Definition at line 249 of file SG_Spatial.h.
References m_ogldirty.
bool SG_Spatial::IsModified | ( | ) | [inline] |
Definition at line 248 of file SG_Spatial.h.
References m_modified.
Referenced by KX_VertexParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
MT_Scalar SG_Spatial::Radius | ( | ) | const [inline] |
Definition at line 246 of file SG_Spatial.h.
References m_radius.
Referenced by KX_Scene::AddReplicaObject(), KX_Scene::DupliGroupRecurse(), and KX_Scene::MarkVisible().
void SG_Spatial::RelativeRotate | ( | const MT_Matrix3x3 & | rot, |
bool | local | ||
) |
Scaling methods. Orientation and rotation methods.
Definition at line 177 of file SG_Spatial.cpp.
References GetWorldOrientation(), m_localRotation, and SetModified().
Referenced by KX_GameObject::ApplyRotation().
void SG_Spatial::RelativeScale | ( | const MT_Vector3 & | scale | ) | [inline] |
Definition at line 164 of file SG_Spatial.h.
References m_localScaling, and SetModified().
Referenced by KX_GameObject::NodeSetRelativeScale().
void SG_Spatial::RelativeTranslate | ( | const MT_Vector3 & | trans, |
const SG_Spatial * | parent, | ||
bool | local | ||
) |
Apply a translation relative to the current position. if local then the translation is assumed to be in the local coordinates of this object. If not then the translation is assumed to be in global coordinates. In this case you must provide a pointer to the parent of this object if it exists otherwise if there is no parent set it to NULL
Position and translation methods
Definition at line 147 of file SG_Spatial.cpp.
References GetWorldOrientation(), m_localPosition, m_localRotation, and SetModified().
Referenced by KX_GameObject::ApplyMovement().
void SG_Spatial::SetBBox | ( | SG_BBox & | bbox | ) | [inline] |
Definition at line 236 of file SG_Spatial.h.
References m_bbox.
Referenced by KX_Scene::AddReplicaObject(), KX_Scene::DupliGroupRecurse(), and gameobject_from_blenderobject().
void SG_Spatial::SetLocalOrientation | ( | const MT_Matrix3x3 & | rot | ) | [inline] |
Definition at line 146 of file SG_Spatial.h.
References m_localRotation, and SetModified().
Referenced by KX_Scene::AddNodeReplicaObject(), bl_ConvertBlenderObject_Single(), KX_GameObject::NodeSetGlobalOrientation(), KX_GameObject::NodeSetLocalOrientation(), KX_GameObject::RemoveParent(), ImageRender::Render(), and KX_MotionState::setWorldOrientation().
void SG_Spatial::SetLocalOrientation | ( | const float * | rot | ) | [inline] |
Definition at line 153 of file SG_Spatial.h.
References m_localRotation, and SetModified().
void SG_Spatial::SetLocalPosition | ( | const MT_Point3 & | trans | ) | [inline] |
Definition at line 128 of file SG_Spatial.h.
References m_localPosition, and SetModified().
Referenced by KX_Scene::AddNodeReplicaObject(), bl_ConvertBlenderObject_Single(), KX_GameObject::NodeSetLocalPosition(), KX_GameObject::RemoveParent(), ImageRender::Render(), and KX_MotionState::setWorldPosition().
void SG_Spatial::SetLocalScale | ( | const MT_Vector3 & | scale | ) | [inline] |
Definition at line 170 of file SG_Spatial.h.
References m_localScaling, and SetModified().
Referenced by KX_Scene::AddNodeReplicaObject(), bl_ConvertBlenderObject_Single(), KX_GameObject::NodeSetLocalScale(), and KX_GameObject::RemoveParent().
void SG_Spatial::SetModified | ( | ) | [inline] |
Definition at line 76 of file SG_Spatial.h.
References SG_IObject::ActivateScheduleUpdateCallback(), and m_modified.
Referenced by RelativeRotate(), RelativeScale(), RelativeTranslate(), SetLocalOrientation(), SetLocalPosition(), SetLocalScale(), and SetParentRelation().
void SG_Spatial::SetParentRelation | ( | SG_ParentRelation * | relation | ) |
Define the realtionship this node has with it's parent node. You should pass an unshared instance of an SG_ParentRelation allocated on the heap to this method. Ownership of this instance is assumed by this class. You may call this function several times in the lifetime of a node to change the relationship dynamically. You must call this method before the first call to UpdateSpatialData(). An assertion willl be fired at run-time in debug if this is not the case. The relation is activated only if no controllers of this object updated the coordinates of the child.
Definition at line 95 of file SG_Spatial.cpp.
References m_parent_relation, and SetModified().
Referenced by KX_Scene::AddNodeReplicaObject(), bl_ConvertBlenderObject_Single(), and KX_GameObject::KX_GameObject().
void SG_Spatial::SetRadius | ( | MT_Scalar | radius | ) | [inline] |
Definition at line 247 of file SG_Spatial.h.
References m_radius.
Referenced by KX_Scene::AddReplicaObject(), KX_Scene::DupliGroupRecurse(), and gameobject_from_blenderobject().
void SG_Spatial::SetWorldFromLocalTransform | ( | ) | [inline] |
Definition at line 211 of file SG_Spatial.h.
References m_localPosition, m_localRotation, m_localScaling, m_worldPosition, m_worldRotation, and m_worldScaling.
Referenced by KX_BoneParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
void SG_Spatial::SetWorldOrientation | ( | const MT_Matrix3x3 & | rot | ) | [inline] |
Definition at line 159 of file SG_Spatial.h.
References m_worldRotation.
Referenced by KX_BoneParentRelation::UpdateChildCoordinates(), KX_SlowParentRelation::UpdateChildCoordinates(), KX_VertexParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
void SG_Spatial::SetWorldPosition | ( | const MT_Point3 & | trans | ) | [inline] |
Definition at line 134 of file SG_Spatial.h.
References m_worldPosition.
Referenced by KX_BoneParentRelation::UpdateChildCoordinates(), KX_SlowParentRelation::UpdateChildCoordinates(), KX_VertexParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
void SG_Spatial::SetWorldScale | ( | const MT_Vector3 & | scale | ) | [inline] |
Definition at line 176 of file SG_Spatial.h.
References m_worldScaling.
Referenced by KX_BoneParentRelation::UpdateChildCoordinates(), KX_SlowParentRelation::UpdateChildCoordinates(), KX_VertexParentRelation::UpdateChildCoordinates(), and KX_NormalParentRelation::UpdateChildCoordinates().
bool SG_Spatial::UpdateSpatialData | ( | const SG_Spatial * | parent, |
double | time, | ||
bool & | parentUpdated | ||
) | [protected] |
Update the world coordinates of this spatial node. This also informs any controllers to update this object.
Update Spatial Data. Calculates WorldTransform., (either doing itsself or using the linked SGControllers)
Definition at line 112 of file SG_Spatial.cpp.
References ComputeWorldTransforms(), and SG_IObject::GetSGControllerList().
Referenced by SG_Node::UpdateWorldData().
friend class KX_BoneParentRelation [friend] |
Definition at line 253 of file SG_Spatial.h.
friend class KX_NormalParentRelation [friend] |
Definition at line 256 of file SG_Spatial.h.
friend class KX_SlowParentRelation [friend] |
Definition at line 255 of file SG_Spatial.h.
friend class KX_VertexParentRelation [friend] |
Definition at line 254 of file SG_Spatial.h.
friend class SG_Controller [friend] |
Definition at line 252 of file SG_Spatial.h.
SG_BBox SG_Spatial::m_bbox [protected] |
Definition at line 65 of file SG_Spatial.h.
Referenced by BBox(), getAABBox(), getBBox(), inside(), and SetBBox().
MT_Point3 SG_Spatial::m_localPosition [protected] |
Definition at line 55 of file SG_Spatial.h.
Referenced by GetLocalPosition(), RelativeTranslate(), SetLocalPosition(), and SetWorldFromLocalTransform().
MT_Matrix3x3 SG_Spatial::m_localRotation [protected] |
Definition at line 56 of file SG_Spatial.h.
Referenced by GetLocalOrientation(), RelativeRotate(), RelativeTranslate(), SetLocalOrientation(), and SetWorldFromLocalTransform().
MT_Vector3 SG_Spatial::m_localScaling [protected] |
Definition at line 57 of file SG_Spatial.h.
Referenced by GetLocalScale(), RelativeScale(), SetLocalScale(), and SetWorldFromLocalTransform().
bool SG_Spatial::m_modified [protected] |
Definition at line 67 of file SG_Spatial.h.
Referenced by ClearModified(), IsModified(), SetModified(), and SG_Node::SG_Node().
bool SG_Spatial::m_ogldirty [protected] |
Definition at line 68 of file SG_Spatial.h.
Referenced by ClearDirty(), ClearModified(), and IsDirty().
SG_ParentRelation* SG_Spatial::m_parent_relation [protected] |
Definition at line 63 of file SG_Spatial.h.
Referenced by ComputeWorldTransforms(), SG_Node::Destruct(), GetParentRelation(), SG_Node::IsSlowParent(), SG_Node::IsVertexParent(), SetParentRelation(), SG_Spatial(), and ~SG_Spatial().
MT_Scalar SG_Spatial::m_radius [protected] |
Definition at line 66 of file SG_Spatial.h.
Referenced by inside(), Radius(), and SetRadius().
MT_Point3 SG_Spatial::m_worldPosition [protected] |
Definition at line 59 of file SG_Spatial.h.
Referenced by GetWorldPosition(), GetWorldTransform(), inside(), SetWorldFromLocalTransform(), and SetWorldPosition().
MT_Matrix3x3 SG_Spatial::m_worldRotation [protected] |
Definition at line 60 of file SG_Spatial.h.
Referenced by GetWorldOrientation(), GetWorldTransform(), SetWorldFromLocalTransform(), and SetWorldOrientation().
MT_Vector3 SG_Spatial::m_worldScaling [protected] |
Definition at line 61 of file SG_Spatial.h.
Referenced by GetWorldScaling(), GetWorldTransform(), inside(), SetWorldFromLocalTransform(), and SetWorldScale().