Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.h')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.h118
1 files changed, 83 insertions, 35 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h
index a7ac2d75a93..472d31362dd 100644
--- a/source/gameengine/Ketsji/KX_GameObject.h
+++ b/source/gameengine/Ketsji/KX_GameObject.h
@@ -54,6 +54,7 @@
//Forward declarations.
struct KX_ClientObjectInfo;
+class KX_RayCast;
class RAS_MeshObject;
class KX_IPhysicsController;
class PHY_IPhysicsEnvironment;
@@ -74,20 +75,23 @@ protected:
int m_layer;
std::vector<RAS_MeshObject*> m_meshes;
struct Object* m_pBlenderObject;
+ struct Object* m_pBlenderGroupObject;
bool m_bSuspendDynamics;
bool m_bUseObjectColor;
bool m_bIsNegativeScaling;
MT_Vector4 m_objectColor;
- // Is this object set to be visible? Only useful for the
- // visibility subsystem right now.
- bool m_bVisible;
+ // visible = user setting
+ // culled = while rendering, depending on camera
+ bool m_bVisible;
+ bool m_bCulled;
KX_IPhysicsController* m_pPhysicsController1;
// used for ray casting
PHY_IPhysicsEnvironment* m_pPhysicsEnvironment;
STR_String m_testPropName;
+ bool m_xray;
KX_GameObject* m_pHitObject;
SG_Node* m_pSGNode;
@@ -260,6 +264,15 @@ public:
bool local=false
);
+ /**
+ * Return the linear velocity of a given point in world coordinate
+ * but relative to center of object ([0,0,0]=center of object)
+ */
+ MT_Vector3
+ GetVelocity(
+ const MT_Point3& position
+ );
+
/**
* Return the mass of the object
*/
@@ -328,6 +341,14 @@ public:
m_pPhysicsController1 = physicscontroller;
}
+ virtual class RAS_Deformer* GetDeformer()
+ {
+ return 0;
+ }
+ virtual void SetDeformer(class RAS_Deformer* deformer)
+ {
+
+ }
/**
* @section Coordinate system manipulation functions
@@ -393,6 +414,16 @@ public:
{
m_pBlenderObject = obj;
}
+
+ struct Object* GetBlenderGroupObject( )
+ {
+ return m_pBlenderGroupObject;
+ }
+
+ void SetBlenderGroupObject( struct Object* obj)
+ {
+ m_pBlenderGroupObject = obj;
+ }
bool IsDupliGroup()
{
@@ -428,7 +459,8 @@ public:
return (m_pSGNode && m_pSGNode->GetSGParent() && m_pSGNode->GetSGParent()->IsVertexParent());
}
- bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data);
+ bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data);
+ bool NeedRayCast(KX_ClientObjectInfo* client);
/**
@@ -535,18 +567,23 @@ public:
/**
* @section Mesh accessor functions.
*/
+
+ /**
+ * Update buckets to indicate that there is a new
+ * user of this object's meshes.
+ */
+ void
+ AddMeshUser(
+ );
/**
- * Run through the meshes associated with this
- * object and bucketize them. See RAS_Mesh for
- * more details on this function. Interesting to
- * note that polygon bucketizing seems to happen on a per
- * object basis. Which may explain why there is such
- * a big performance gain when all static objects
- * are joined into 1.
+ * Update buckets with data about the mesh after
+ * creating or duplicating the object, changing
+ * visibility, object color, .. .
*/
void
- Bucketize(
+ UpdateBuckets(
+ bool recursive
);
/**
@@ -607,38 +644,38 @@ public:
ResetDebugColor(
);
- /**
- * Set the visibility of the meshes associated with this
- * object.
+ /**
+ * Was this object marked visible? (only for the explicit
+ * visibility system).
*/
- void
- MarkVisible(
- bool visible
+ bool
+ GetVisible(
+ void
);
- /**
- * Set the visibility according to the visibility flag.
+ /**
+ * Set visibility flag of this object
*/
- void
- MarkVisible(
void
+ SetVisible(
+ bool b,
+ bool recursive
);
/**
- * Was this object marked visible? (only for the ewxplicit
- * visibility system).
+ * Was this object culled?
*/
bool
- GetVisible(
+ GetCulled(
void
);
/**
- * Set visibility flag of this object
+ * Set culled flag of this object
*/
void
- SetVisible(
- bool b
+ SetCulled(
+ bool c
);
/**
@@ -667,6 +704,14 @@ public:
) { return m_bIsNegativeScaling; }
/**
+ * Is this a light?
+ */
+ virtual bool
+ IsLight(
+ void
+ ) { return false; }
+
+ /**
* @section Logic bubbling methods.
*/
@@ -726,31 +771,34 @@ public:
KX_PYMETHOD_NOARGS(KX_GameObject,GetPosition);
KX_PYMETHOD_O(KX_GameObject,SetPosition);
- KX_PYMETHOD(KX_GameObject,GetLinearVelocity);
- KX_PYMETHOD(KX_GameObject,SetLinearVelocity);
- KX_PYMETHOD(KX_GameObject,GetVelocity);
+ KX_PYMETHOD_O(KX_GameObject,SetWorldPosition);
+ KX_PYMETHOD_VARARGS(KX_GameObject,GetLinearVelocity);
+ KX_PYMETHOD_VARARGS(KX_GameObject,SetLinearVelocity);
+ KX_PYMETHOD_VARARGS(KX_GameObject,GetAngularVelocity);
+ KX_PYMETHOD_VARARGS(KX_GameObject,SetAngularVelocity);
+ KX_PYMETHOD_VARARGS(KX_GameObject,GetVelocity);
KX_PYMETHOD_NOARGS(KX_GameObject,GetMass);
KX_PYMETHOD_NOARGS(KX_GameObject,GetReactionForce);
KX_PYMETHOD_NOARGS(KX_GameObject,GetOrientation);
KX_PYMETHOD_O(KX_GameObject,SetOrientation);
KX_PYMETHOD_NOARGS(KX_GameObject,GetVisible);
- KX_PYMETHOD_O(KX_GameObject,SetVisible);
+ KX_PYMETHOD_VARARGS(KX_GameObject,SetVisible);
KX_PYMETHOD_NOARGS(KX_GameObject,GetState);
KX_PYMETHOD_O(KX_GameObject,SetState);
- KX_PYMETHOD(KX_GameObject,AlignAxisToVect);
+ KX_PYMETHOD_VARARGS(KX_GameObject,AlignAxisToVect);
KX_PYMETHOD_O(KX_GameObject,GetAxisVect);
KX_PYMETHOD_NOARGS(KX_GameObject,SuspendDynamics);
KX_PYMETHOD_NOARGS(KX_GameObject,RestoreDynamics);
KX_PYMETHOD_NOARGS(KX_GameObject,EnableRigidBody);
KX_PYMETHOD_NOARGS(KX_GameObject,DisableRigidBody);
- KX_PYMETHOD(KX_GameObject,ApplyImpulse);
+ KX_PYMETHOD_VARARGS(KX_GameObject,ApplyImpulse);
KX_PYMETHOD_O(KX_GameObject,SetCollisionMargin);
KX_PYMETHOD_NOARGS(KX_GameObject,GetParent);
KX_PYMETHOD_O(KX_GameObject,SetParent);
KX_PYMETHOD_NOARGS(KX_GameObject,RemoveParent);
KX_PYMETHOD_NOARGS(KX_GameObject,GetChildren);
KX_PYMETHOD_NOARGS(KX_GameObject,GetChildrenRecursive);
- KX_PYMETHOD(KX_GameObject,GetMesh);
+ KX_PYMETHOD_VARARGS(KX_GameObject,GetMesh);
KX_PYMETHOD_NOARGS(KX_GameObject,GetPhysicsId);
KX_PYMETHOD_NOARGS(KX_GameObject,GetPropertyNames);
KX_PYMETHOD_NOARGS(KX_GameObject,EndObject);