Blender V2.61 - r43446
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

KX_ConstraintActuator Class Reference

#include <KX_ConstraintActuator.h>

Inheritance diagram for KX_ConstraintActuator:
Inheritance graph
[legend]

List of all members.

Public Types

enum  KX_CONSTRAINTTYPE {
  KX_ACT_CONSTRAINT_NODEF = 0, KX_ACT_CONSTRAINT_LOCX, KX_ACT_CONSTRAINT_LOCY, KX_ACT_CONSTRAINT_LOCZ,
  KX_ACT_CONSTRAINT_ROTX, KX_ACT_CONSTRAINT_ROTY, KX_ACT_CONSTRAINT_ROTZ, KX_ACT_CONSTRAINT_DIRPX,
  KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY,
  KX_ACT_CONSTRAINT_DIRNZ, KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ,
  KX_ACT_CONSTRAINT_FHPX, KX_ACT_CONSTRAINT_FHPY, KX_ACT_CONSTRAINT_FHPZ, KX_ACT_CONSTRAINT_FHNX,
  KX_ACT_CONSTRAINT_FHNY, KX_ACT_CONSTRAINT_FHNZ, KX_ACT_CONSTRAINT_MAX
}
enum  KX_CONSTRAINTOPT {
  KX_ACT_CONSTRAINT_NORMAL = 64, KX_ACT_CONSTRAINT_MATERIAL = 128, KX_ACT_CONSTRAINT_PERMANENT = 256, KX_ACT_CONSTRAINT_DISTANCE = 512,
  KX_ACT_CONSTRAINT_LOCAL = 1024, KX_ACT_CONSTRAINT_DOROTFH = 2048
}

Public Member Functions

bool IsValidMode (KX_CONSTRAINTTYPE m)
bool RayHit (KX_ClientObjectInfo *client, KX_RayCast *result, void *const data)
bool NeedRayCast (KX_ClientObjectInfo *)
 KX_ConstraintActuator (SCA_IObject *gameobj, int posDamptime, int rotDampTime, float min, float max, float refDir[3], int locrot, int time, int option, char *property)
virtual ~KX_ConstraintActuator ()
virtual CValueGetReplica ()
virtual bool Update (double curtime, bool frame)

Static Public Member Functions

static int pyattr_check_direction (void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
static int pyattr_check_min (void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)

Protected Member Functions

void Clamp (MT_Scalar &var, float min, float max)

Protected Attributes

int m_posDampTime
int m_rotDampTime
float m_minimumBound
float m_maximumBound
float m_minimumSine
float m_maximumSine
float m_refDirection [3]
MT_Vector3 m_refDirVector
int m_locrot
int m_activeTime
int m_currentTime
int m_option
STR_String m_property
KX_GameObjectm_hitObject

Detailed Description

Definition at line 43 of file KX_ConstraintActuator.h.


Member Enumeration Documentation

Enumerator:
KX_ACT_CONSTRAINT_NORMAL 
KX_ACT_CONSTRAINT_MATERIAL 
KX_ACT_CONSTRAINT_PERMANENT 
KX_ACT_CONSTRAINT_DISTANCE 
KX_ACT_CONSTRAINT_LOCAL 
KX_ACT_CONSTRAINT_DOROTFH 

Definition at line 108 of file KX_ConstraintActuator.h.

Enumerator:
KX_ACT_CONSTRAINT_NODEF 
KX_ACT_CONSTRAINT_LOCX 
KX_ACT_CONSTRAINT_LOCY 
KX_ACT_CONSTRAINT_LOCZ 
KX_ACT_CONSTRAINT_ROTX 
KX_ACT_CONSTRAINT_ROTY 
KX_ACT_CONSTRAINT_ROTZ 
KX_ACT_CONSTRAINT_DIRPX 
KX_ACT_CONSTRAINT_DIRPY 
KX_ACT_CONSTRAINT_DIRPZ 
KX_ACT_CONSTRAINT_DIRNX 
KX_ACT_CONSTRAINT_DIRNY 
KX_ACT_CONSTRAINT_DIRNZ 
KX_ACT_CONSTRAINT_ORIX 
KX_ACT_CONSTRAINT_ORIY 
KX_ACT_CONSTRAINT_ORIZ 
KX_ACT_CONSTRAINT_FHPX 
KX_ACT_CONSTRAINT_FHPY 
KX_ACT_CONSTRAINT_FHPZ 
KX_ACT_CONSTRAINT_FHNX 
KX_ACT_CONSTRAINT_FHNY 
KX_ACT_CONSTRAINT_FHNZ 
KX_ACT_CONSTRAINT_MAX 

Definition at line 82 of file KX_ConstraintActuator.h.


Constructor & Destructor Documentation

KX_ConstraintActuator::KX_ConstraintActuator ( SCA_IObject gameobj,
int  posDamptime,
int  rotDampTime,
float  min,
float  max,
float  refDir[3],
int  locrot,
int  time,
int  option,
char *  property 
)
KX_ConstraintActuator::~KX_ConstraintActuator ( ) [virtual]

Definition at line 114 of file KX_ConstraintActuator.cpp.


Member Function Documentation

void KX_ConstraintActuator::Clamp ( MT_Scalar var,
float  min,
float  max 
) [protected]

Clamp to <min>, <max>. Borders are included (in as far as float comparisons are good for equality...).

Definition at line 542 of file KX_ConstraintActuator.cpp.

References max, and min.

Referenced by Update().

virtual CValue* KX_ConstraintActuator::GetReplica ( void  ) [inline, virtual]

Implements CValue.

Definition at line 131 of file KX_ConstraintActuator.h.

References KX_ConstraintActuator(), and SCA_IActuator::ProcessReplica().

bool KX_ConstraintActuator::IsValidMode ( KX_ConstraintActuator::KX_CONSTRAINTTYPE  m)

Definition at line 553 of file KX_ConstraintActuator.cpp.

References KX_ACT_CONSTRAINT_MAX, and KX_ACT_CONSTRAINT_NODEF.

bool KX_ConstraintActuator::NeedRayCast ( KX_ClientObjectInfo client)
static int KX_ConstraintActuator::pyattr_check_direction ( void *  self,
const struct KX_PYATTRIBUTE_DEF *  attrdef 
) [static]
static int KX_ConstraintActuator::pyattr_check_min ( void *  self,
const struct KX_PYATTRIBUTE_DEF *  attrdef 
) [static]
bool KX_ConstraintActuator::RayHit ( KX_ClientObjectInfo client,
KX_RayCast result,
void *const  data 
)
bool KX_ConstraintActuator::Update ( double  curtime,
bool  frame 
) [virtual]

Update(...) Update the actuator based upon the events received since the last call to Update, the current time and deltatime the time elapsed in this frame ? It is the responsibility of concrete Actuators to clear their event's. This is usually done in the Update() method via a call to RemoveAllEvents()

Reimplemented from SCA_IActuator.

Definition at line 166 of file KX_ConstraintActuator.cpp.

References KX_GameObject::AlignAxisToVect(), Clamp(), MT_Vector3::cross(), distance(), MT_Vector3::dot(), filter(), KX_IPhysicsController::GetAngularVelocity(), KX_IPhysicsController::GetLinearVelocity(), SG_Spatial::GetLocalPosition(), SCA_ILogicBrick::GetName(), KX_GameObject::GetParent(), SCA_ILogicBrick::GetParent(), KX_GameObject::GetPhysicsController(), KX_Scene::GetPhysicsEnvironment(), KX_IPhysicsController::GetRadius(), KX_GameObject::GetSGNode(), KX_GameObject::GetVelocity(), KX_IPhysicsController::IsDyna(), SCA_IActuator::IsNegativeEvent(), KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ, KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, KX_ACT_CONSTRAINT_DISTANCE, KX_ACT_CONSTRAINT_DOROTFH, KX_ACT_CONSTRAINT_FHNX, KX_ACT_CONSTRAINT_FHNY, KX_ACT_CONSTRAINT_FHNZ, KX_ACT_CONSTRAINT_FHPX, KX_ACT_CONSTRAINT_FHPY, KX_ACT_CONSTRAINT_FHPZ, KX_ACT_CONSTRAINT_LOCAL, KX_ACT_CONSTRAINT_LOCX, KX_ACT_CONSTRAINT_LOCY, KX_ACT_CONSTRAINT_LOCZ, KX_ACT_CONSTRAINT_NORMAL, KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ, KX_ACT_CONSTRAINT_PERMANENT, KX_GetActiveScene(), length(), MT_Vector3::length2(), m_activeTime, m_currentTime, KX_RayCast::m_hitNormal, m_hitObject, KX_RayCast::m_hitPoint, m_locrot, m_maximumBound, m_maximumSine, m_minimumBound, m_minimumSine, m_option, m_posDampTime, m_refDirVector, m_rotDampTime, MT_EPSILON(), MT_fuzzyZero(), MT_fuzzyZero2(), KX_GameObject::NodeGetWorldOrientation(), KX_GameObject::NodeGetWorldPosition(), KX_GameObject::NodeSetLocalPosition(), KX_GameObject::NodeSetWorldPosition(), MT_Vector3::normalize(), NULL, KX_RayCast::RayTest(), CValue::Release(), SCA_IActuator::RemoveAllEvents(), KX_IPhysicsController::SetAngularVelocity(), KX_IPhysicsController::SetLinearVelocity(), and TNT::sign().


Member Data Documentation

Definition at line 64 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator(), and Update().

Definition at line 65 of file KX_ConstraintActuator.h.

Referenced by Update().

Definition at line 71 of file KX_ConstraintActuator.h.

Referenced by RayHit(), and Update().

Definition at line 62 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator(), and Update().

Definition at line 53 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator(), and Update().

Definition at line 57 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator(), and Update().

Definition at line 51 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator(), and Update().

Definition at line 55 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator(), and Update().

Definition at line 67 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator(), RayHit(), and Update().

Definition at line 48 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator(), and Update().

Definition at line 69 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator(), and RayHit().

Definition at line 59 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator().

Definition at line 60 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator(), and Update().

Definition at line 49 of file KX_ConstraintActuator.h.

Referenced by KX_ConstraintActuator(), and Update().


The documentation for this class was generated from the following files: