Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Physics3D6DofConstraint Class Reference

This generic constraint can emulate a variety of standard constraints, by configuring each of the 6 degrees of freedom (dof). More...

Inherits Physics3DConstraint.

Public Member Functions

void setLinearLowerLimit (const cocos2d::Vec3 &linearLower)
 set linear lower limit
 
cocos2d::Vec3 getLinearLowerLimit () const
 get linear lower limit
 
void setLinearUpperLimit (const cocos2d::Vec3 &linearUpper)
 set linear upper limit
 
var setLinearUpperLimit ( var linearUpper)
 set linear upper limit
 
local setLinearUpperLimit ( local linearUpper)
 set linear upper limit
 
cocos2d::Vec3 getLinearUpperLimit () const
 get linear upper limit
 
void setAngularLowerLimit (const cocos2d::Vec3 &angularLower)
 set angular lower limit
 
cocos2d::Vec3 getAngularLowerLimit () const
 get angular lower limit
 
void setAngularUpperLimit (const cocos2d::Vec3 &angularUpper)
 set angular upper limit
 
var setAngularUpperLimit ( var angularUpper)
 set angular upper limit
 
local setAngularUpperLimit ( local angularUpper)
 set angular upper limit
 
cocos2d::Vec3 getAngularUpperLimit () const
 get angular upper limit
 
bool isLimited (int limitIndex) const
 is limited? first 3 are linear, next 3 are angular
 
bool getUseFrameOffset () const
 access for UseFrameOffset
 
void setUseFrameOffset (bool frameOffsetOnOff) const
 set use frame offset
 
var setUseFrameOffset ( var frameOffsetOnOff)
 set use frame offset
 
local setUseFrameOffset ( local frameOffsetOnOff)
 set use frame offset
 
- Public Member Functions inherited from Physics3DConstraint
float getBreakingImpulse () const
 get the impulse that break the constraint the impulse that break the constraint
 
var getBreakingImpulse ()
 get the impulse that break the constraint the impulse that break the constraint
 
local getBreakingImpulse ()
 get the impulse that break the constraint the impulse that break the constraint
 
void setBreakingImpulse (float impulse)
 set the impulse that break the constraint the impulse that break the constraint
 
bool isEnabled () const
 is it enabled whether the constraint is enabled
 
void setEnabled (bool enabled)
 set enable or not whether the constraint will be enabled
 
Physics3DRigidBodygetBodyA () const
 get rigid body a the Physics3DRigidBody A
 
local getBodyA ()
 get rigid body a the Physics3DRigidBody A
 
Physics3DRigidBodygetBodyB () const
 get rigid body b the Physics3DRigidBody B
 
local getBodyB ()
 get rigid body b the Physics3DRigidBody B
 
ConstraintType getConstraintType () const
 get constraint type the constraint type
 
var getConstraintType ()
 get constraint type the constraint type
 
local getConstraintType ()
 get constraint type the constraint type
 
void setUserData (void *userData)
 get user data the user data will be seted
 
void * getUserData () const
 get user data the user data
 
int getOverrideNumSolverIterations () const
 get override number of solver iterations the override number of solver iterations
 
void setOverrideNumSolverIterations (int overideNumIterations)
 override the number of constraint solver iterations used to solve this constraint, -1 will use the default number of iterations, as specified in SolverInfo.m_numIterations the number of constraint solver iterations
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

Static Public Member Functions

static Physics3D6DofConstraintcreate (Physics3DRigidBody *rbA, Physics3DRigidBody *rbB, const cocos2d::Mat4 &frameInA, const cocos2d::Mat4 &frameInB, bool useLinearReferenceFrameA)
 create 6 dof constraint rigid body A rigid body B frame in A's local space frame in B's local space use fixed frame A for linear limits
 
var create ( var rbA, var rbB, var frameInA, var frameInB, var useLinearReferenceFrameA)
 create 6 dof constraint rigid body A rigid body B frame in A's local space frame in B's local space use fixed frame A for linear limits
 
local create ( local rbA, local rbB, local frameInA, local frameInB, local useLinearReferenceFrameA)
 create 6 dof constraint rigid body A rigid body B frame in A's local space frame in B's local space use fixed frame A for linear limits
 
static Physics3D6DofConstraintcreate (Physics3DRigidBody *rbB, const cocos2d::Mat4 &frameInB, bool useLinearReferenceFrameB)
 create 6 dof constraint rigid body B frame in B's local space use fixed frame B for linear limits
 
var create ( var rbB, var frameInB, var useLinearReferenceFrameB)
 create 6 dof constraint rigid body B frame in B's local space use fixed frame B for linear limits
 
local create ( local rbB, local frameInB, local useLinearReferenceFrameB)
 create 6 dof constraint rigid body B frame in B's local space use fixed frame B for linear limits
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

This generic constraint can emulate a variety of standard constraints, by configuring each of the 6 degrees of freedom (dof).

The first 3 dof axis are linear axis, which represent translation of rigidbodies, and the latter 3 dof axis represent the angular motion. Each axis can be either locked, free or limited. All axis are locked by default. For each axis:

Lowerlimit == Upperlimit -> axis is locked. Lowerlimit > Upperlimit -> axis is free Lowerlimit < Upperlimit -> axis it limited in that range


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