Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
CompoundShape::SubShape Struct Reference

#include <CompoundShape.h>

Public Member Functions

bool FromSettings (const CompoundShapeSettings::SubShapeSettings &inSettings, ShapeResult &outResult)
 
JPH_INLINE void SetTransform (Vec3Arg inPosition, QuatArg inRotation, Vec3Arg inCenterOfMass)
 
JPH_INLINE Mat44 GetLocalTransformNoScale (Vec3Arg inScale) const
 
bool IsValidScale (Vec3Arg inScale) const
 Test if inScale is valid for this sub shape.
 
Vec3 TransformScale (Vec3Arg inScale) const
 Transform the scale to the local space of the child shape.
 
JPH_INLINE void SetPositionCOM (Vec3Arg inPositionCOM)
 Compress the center of mass position.
 
JPH_INLINE Vec3 GetPositionCOM () const
 Uncompress the center of mass position.
 
JPH_INLINE void SetRotation (QuatArg inRotation)
 Compress the rotation.
 
JPH_INLINE Quat GetRotation () const
 Uncompress the rotation.
 

Public Attributes

RefConst< ShapemShape
 
Float3 mPositionCOM
 Note: Position of center of mass of sub shape!
 
Float3 mRotation
 Note: X, Y, Z of rotation quaternion - note we read 4 bytes beyond this so make sure there's something there.
 
uint32 mUserData
 User data value (put here because it falls in padding bytes)
 
bool mIsRotationIdentity
 If mRotation is close to identity (put here because it falls in padding bytes)
 

Member Function Documentation

◆ FromSettings()

bool CompoundShape::SubShape::FromSettings ( const CompoundShapeSettings::SubShapeSettings inSettings,
ShapeResult outResult 
)
inline

Initialize sub shape from sub shape settings

Parameters
inSettingsSettings object
outResultResult object, only used in case of error
Returns
True on success, false on failure

◆ GetLocalTransformNoScale()

JPH_INLINE Mat44 CompoundShape::SubShape::GetLocalTransformNoScale ( Vec3Arg  inScale) const
inline

Get the local transform for this shape given the scale of the child shape The total transform of the child shape will be GetLocalTransformNoScale(inScale) * Mat44::sScaling(TransformScale(inScale))

Parameters
inScaleThe scale of the child shape (in local space of this shape)

◆ GetPositionCOM()

JPH_INLINE Vec3 CompoundShape::SubShape::GetPositionCOM ( ) const
inline

Uncompress the center of mass position.

◆ GetRotation()

JPH_INLINE Quat CompoundShape::SubShape::GetRotation ( ) const
inline

Uncompress the rotation.

◆ IsValidScale()

bool CompoundShape::SubShape::IsValidScale ( Vec3Arg  inScale) const
inline

Test if inScale is valid for this sub shape.

◆ SetPositionCOM()

JPH_INLINE void CompoundShape::SubShape::SetPositionCOM ( Vec3Arg  inPositionCOM)
inline

Compress the center of mass position.

◆ SetRotation()

JPH_INLINE void CompoundShape::SubShape::SetRotation ( QuatArg  inRotation)
inline

Compress the rotation.

◆ SetTransform()

JPH_INLINE void CompoundShape::SubShape::SetTransform ( Vec3Arg  inPosition,
QuatArg  inRotation,
Vec3Arg  inCenterOfMass 
)
inline

Update the transform of this sub shape

Parameters
inPositionNew position
inRotationNew orientation
inCenterOfMassThe center of mass of the compound shape

◆ TransformScale()

Vec3 CompoundShape::SubShape::TransformScale ( Vec3Arg  inScale) const
inline

Transform the scale to the local space of the child shape.

Member Data Documentation

◆ mIsRotationIdentity

bool CompoundShape::SubShape::mIsRotationIdentity

If mRotation is close to identity (put here because it falls in padding bytes)

◆ mPositionCOM

Float3 CompoundShape::SubShape::mPositionCOM

Note: Position of center of mass of sub shape!

◆ mRotation

Float3 CompoundShape::SubShape::mRotation

Note: X, Y, Z of rotation quaternion - note we read 4 bytes beyond this so make sure there's something there.

◆ mShape

RefConst<Shape> CompoundShape::SubShape::mShape

◆ mUserData

uint32 CompoundShape::SubShape::mUserData

User data value (put here because it falls in padding bytes)


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