Search Results for

    Show / Hide Table of Contents

    Class RigidBody

    Physics simulation driven object.

    Inheritance
    Object
    ScriptingObject
    SceneObject
    Actor
    RigidBody
    Inherited Members
    Actor::_box
    Actor::_drawCategory
    Actor::_drawNoCulling
    ScriptingObject::_gcHandle
    ScriptingObject::_id
    Actor::_isActive
    Actor::_isActiveInHierarchy
    Actor::_isEnabled
    Actor::_isHierarchyDirty
    Actor::_isPrefabRoot
    Actor::_layer
    Actor::_localTransform
    Actor::_name
    SceneObject::_parent
    Actor::_physicsScene
    SceneObject::_prefabID
    SceneObject::_prefabObjectID
    Actor::_scene
    Actor::_sphere
    Actor::_staticFlags
    Actor::_transform
    ScriptingObject::_type
    Actor::AddMovement(const Vector3& translation)
    Actor::AddScript()
    Actor::AddStaticFlags(StaticFlags flags)
    Actor::AddTag(const Tag& tag)
    Actor::AddTagRecursive(const Tag& tag)
    RigidBody
    Actor::BreakPrefabLink()
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    ScriptingObject::Cast(ScriptingObject* obj)
    ScriptingObject::ChangeID(const Guid& newId)
    Actor::ChangeScriptOrder(Script* script, int32 newIndex)
    Actor::Children
    Actor::Clone()
    ScriptingObject::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    ScriptingObject::Deleted
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    Actor::DEPRECATED("Use HasTag instead") const String& GetTag()
    Actor::DEPRECATED("Use AddTag instead") void SetTag(const StringView& value)
    ISerializable::DeserializeIfExists(DeserializeStream& stream, const char* memberName, ISerializeModifier* modifier)
    RigidBody
    Actor::DestroyChildren(float timeLeft = 0.0f)
    ScriptingObject::DestroyManaged()
    Actor::Draw(RenderContext& renderContext)
    Actor::Draw(RenderContextBatch& renderContextBatch)
    Actor::FindActor(const StringView& name)
    Actor::FindActor(const MClass* type, bool activeOnly=false)
    Actor::FindActor(const MClass* type, const StringView& name)
    Actor::FindActor(const MClass* type, const Tag& tag, bool activeOnly=false)
    Actor::FindActor()
    Actor::FindActor(const Tag& tag)
    Actor::FindScript(const MClass* type)
    Actor::FindScript()
    Object::Flags
    Actor::FromBytes(const Span<byte>& data, Array<Actor* >& output, ISerializeModifier* modifier)
    Actor::FromBytes(const Span<byte>& data)
    Actor::FromBytes(const Span<byte>& data, const Dictionary<Guid, Guid, HeapAllocation>& idsMapping)
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    Actor::FromJson(const StringAnsiView& json)
    Actor::GetBox()
    Actor::GetBoxWithChildren()
    Actor::GetChild(int32 index)
    Actor::GetChild(const StringView& name)
    Actor::GetChild(const MClass* type)
    Actor::GetChild()
    Actor::GetChildren(const MClass* type)
    Actor::GetChildren()
    Actor::GetChildrenCount()
    ScriptingObject::GetClass()
    Actor::GetDirection()
    Actor::GetEditorBox()
    Actor::GetEditorBoxChildren()
    ScriptingObject::GetID()
    Actor::GetIsActive()
    Actor::GetLayer()
    Actor::GetLayerMask()
    Actor::GetLayerName()
    Actor::GetLocalOrientation()
    Actor::GetLocalPosition()
    Actor::GetLocalScale()
    Actor::GetLocalToWorldMatrix(Matrix& localToWorld)
    Actor::GetLocalToWorldMatrix(Double4x4& localToWorld)
    Actor::GetLocalTransform()
    ScriptingObject::GetManagedInstance()
    Actor::GetName()
    SceneObject::GetNamePath(Char separatorChar='/')
    Actor::GetOrAddChild()
    ScriptingObject::GetOrCreateManagedInstance()
    Actor::GetOrderInParent()
    Actor::GetOrientation()
    SceneObject::GetParent()
    Actor::GetPerInstanceRandom()
    Actor::GetPhysicsScene()
    Actor::GetPosition()
    SceneObject::GetPrefabID()
    SceneObject::GetPrefabObjectID()
    Actor::GetPrefabRoot()
    Actor::GetRotation()
    Actor::GetScale()
    Actor::GetScene()
    Actor::GetSceneObjectId()
    Actor::GetSceneRendering()
    Actor::GetScript(int32 index)
    Actor::GetScript(const MClass* type)
    Actor::GetScript()
    Actor::GetScriptByID(const Guid& id)
    Actor::GetScripts(const MClass* type)
    Actor::GetScripts()
    Actor::GetScriptsCount()
    Actor::GetSphere()
    Actor::GetStaticFlags()
    Actor::GetTransform()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    Actor::GetWorldToLocalMatrix(Matrix& worldToLocal)
    Actor::GetWorldToLocalMatrix(Double4x4& worldToLocal)
    Actor::HasActorInChildren(Actor* a)
    Actor::HasActorInHierarchy(Actor* a)
    Actor::HasContentLoaded()
    ScriptingObject::HasManagedInstance()
    SceneObject::HasParent()
    SceneObject::HasPrefabLink()
    Actor::HasScene()
    Actor::HasStaticFlag(StaticFlags flag)
    Actor::HasTag()
    Actor::HasTag(const Tag& tag)
    Actor::HasTag(const StringView& tag)
    Actor::HideFlags
    Actor::Initialize()
    Actor::InitializeHierarchy()
    Actor::Intersects(const Ray& ray, Real& distance, Vector3& normal)
    Actor::IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    Actor::IsActiveInHierarchy()
    SceneObject::IsDuringPlay()
    Actor::IsPrefabRoot()
    ScriptingObject::IsRegistered()
    Actor::IsStatic()
    Actor::IsTransformStatic()
    Actor::LinkPrefab(const Guid& prefabId, const Guid& prefabObjectId)
    Actor::LookAt(const Vector3& worldPos)
    Actor::LookAt(const Vector3& worldPos, const Vector3& worldUp)
    Actor::LookingAt(const Vector3& worldPos)
    Actor::LookingAt(const Vector3& worldPos, const Vector3& worldUp)
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    Actor::OnActiveChanged()
    Actor::OnBeginPlay()
    Actor::OnDebugDraw()
    Actor::OnDebugDrawSelected()
    Actor::OnDeleteObject()
    Actor::OnDisable()
    Actor::OnEnable()
    Actor::OnEndPlay()
    Actor::OnLayerChanged()
    ScriptingObject::OnManagedInstanceDeleted()
    Actor::OnOrderInParentChanged()
    Actor::OnParentChanged()
    ScriptingObject::OnScriptingDispose()
    Actor::OnStaticFlagsChanged()
    ScriptingObject::RegisterObject()
    Actor::RemoveStaticFlags(StaticFlags flags)
    Actor::RemoveTag(const Tag& tag)
    Actor::ResetLocalTransform()
    SceneObject::SceneObject(const SpawnParams& params)
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    Actor::Scripts
    RigidBody
    RigidBody
    Actor::SetDirection(const Float3& value)
    Actor::SetIsActive(bool value)
    Actor::SetLayer(int32 layerIndex)
    Actor::SetLayerName(const StringView& value)
    Actor::SetLayerNameRecursive(const StringView& value)
    Actor::SetLayerRecursive(int32 layerIndex)
    Actor::SetLocalOrientation(const Quaternion& value)
    Actor::SetLocalPosition(const Vector3& value)
    Actor::SetLocalScale(const Float3& value)
    Actor::SetLocalTransform(const Transform& value)
    ScriptingObject::SetManagedInstance(MObject* instance)
    Actor::SetName(String&& value)
    Actor::SetName(const StringView& value)
    Actor::SetOrderInParent(int32 index)
    Actor::SetOrientation(const Quaternion& value)
    Actor::SetParent(Actor* value, bool worldPositionsStays, bool canBreakPrefabLink)
    Actor::SetParent(Actor* value, bool canBreakPrefabLink=true)
    SceneObject::SetParent(Actor* value)
    Actor::SetPhysicsScene(PhysicsScene* scene)
    Actor::SetPosition(const Vector3& value)
    Actor::SetRotation(const Matrix& value)
    Actor::SetScale(const Float3& value)
    Actor::SetStaticFlag(StaticFlags flag, bool value)
    Actor::SetStaticFlags(StaticFlags value)
    Actor::SetTransform(const Transform& value)
    RigidBody
    Actor::Tags
    Actor::ToBytes(const Array<Actor* >& actors, MemoryWriteStream& output)
    Actor::ToBytes(const Array<Actor* >& actors)
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    Actor::ToJson()
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    Actor::ToString()
    Actor::TreeExecute(Function<bool(Actor* , Params ...)>& action, Params ... args)
    Actor::TreeExecuteChildren(Function<bool(Actor* , Params ...)>& action, Params ... args)
    Actor::TryGetSerializedObjectsIds(const Span<byte>& data)
    ScriptingObject::UnregisterObject()
    Actor::UnregisterObjectHierarchy()
    IPhysicsActor::~IPhysicsActor()
    ISerializable::~ISerializable()
    Object::~Object()
    SceneObject::~SceneObject()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Physics/Actors/RigidBody.h
    Syntax
    public class RigidBody : public Actor, public IPhysicsActor

    Fields

    _actor

    Declaration
    protected void* _actor
    Field Value
    void

    _angularDamping

    Declaration
    protected float _angularDamping
    Field Value
    float

    _cachedScale

    Declaration
    protected Float3 _cachedScale
    Field Value
    Float3

    _centerOfMassOffset

    Declaration
    protected Float3 _centerOfMassOffset
    Field Value
    Float3

    _constraints

    Declaration
    protected RigidbodyConstraints _constraints
    Field Value
    RigidbodyConstraints

    _enableGravity

    Declaration
    protected uint32 _enableGravity
    Field Value
    uint32

    _enableSimulation

    Declaration
    protected uint32 _enableSimulation
    Field Value
    uint32

    _isKinematic

    Declaration
    protected uint32 _isKinematic
    Field Value
    uint32

    _isUpdatingTransform

    Declaration
    protected uint32 _isUpdatingTransform
    Field Value
    uint32

    _linearDamping

    Declaration
    protected float _linearDamping
    Field Value
    float

    _mass

    Declaration
    protected float _mass
    Field Value
    float

    _massScale

    Declaration
    protected float _massScale
    Field Value
    float

    _maxAngularVelocity

    Declaration
    protected float _maxAngularVelocity
    Field Value
    float

    _overrideMass

    Declaration
    protected uint32 _overrideMass
    Field Value
    uint32

    _startAwake

    Declaration
    protected uint32 _startAwake
    Field Value
    uint32

    _updateMassWhenScaleChanges

    Declaration
    protected uint32 _updateMassWhenScaleChanges
    Field Value
    uint32

    _useCCD

    Declaration
    protected uint32 _useCCD
    Field Value
    uint32

    CollisionEnter

    Occurs when a collision start gets registered for this rigidbody (it collides with something).

    Declaration
    public Delegate<Collision> CollisionEnter
    Field Value
    Delegate<Collision>

    CollisionExit

    Occurs when a collision end gets registered for this rigidbody (it ends colliding with something).

    Declaration
    public Delegate<Collision> CollisionExit
    Field Value
    Delegate<Collision>

    TriggerEnter

    Occurs when this rigidbody trigger touching start gets registered for this collider (the other collider enters it and triggers the event).

    Declaration
    public Delegate<PhysicsColliderActor* > TriggerEnter
    Field Value
    Delegate<PhysicsColliderActor >

    TriggerExit

    Occurs when this rigidbody trigger touching end gets registered for this collider (the other collider enters it and triggers the event).

    Declaration
    public Delegate<PhysicsColliderActor* > TriggerExit
    Field Value
    Delegate<PhysicsColliderActor >

    Methods

    AddForce(const Vector3& force, ForceMode mode=ForceMode::Force)

    Applies a force (or impulse) defined in the world space to the rigidbody at its center of mass.

    This will not induce any torque

    ForceMode determines if the force is to be conventional or impulsive.

    Each actor has an acceleration and a velocity change accumulator which are directly modified using the modes ForceMode::Acceleration and ForceMode::VelocityChange respectively. The modes ForceMode::Force and ForceMode::Impulse also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse mass and then using ForceMode::Acceleration and ForceMode::VelocityChange respectively.

    Declaration
    public void AddForce(const Vector3& force, ForceMode mode=ForceMode::Force) const
    Parameters
    Vector3 force

    The force/impulse to apply defined in the world space.

    ForceMode mode

    The mode to use when applying the force/impulse.

    AddForceAtPosition(const Vector3& force, const Vector3& position, ForceMode mode=ForceMode::Force)

    Applies a force (or impulse) defined in the world space to the rigidbody at given position in the world space.

    Also applies appropriate amount of torque

    ForceMode determines if the force is to be conventional or impulsive.

    Each actor has an acceleration and a velocity change accumulator which are directly modified using the modes ForceMode::Acceleration and ForceMode::VelocityChange respectively. The modes ForceMode::Force and ForceMode::Impulse also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse mass and then using ForceMode::Acceleration and ForceMode::VelocityChange respectively.

    Declaration
    public void AddForceAtPosition(const Vector3& force, const Vector3& position, ForceMode mode=ForceMode::Force) const
    Parameters
    Vector3 force

    The force/impulse to apply defined in the world space.

    Vector3 position

    The position of the force/impulse in the world space.

    ForceMode mode

    The mode to use when applying the force/impulse.

    AddMovement(const Vector3& translation, const Quaternion& rotation)

    Moves the actor (also can rotate it) in world space.

    Declaration
    public virtual void AddMovement(const Vector3& translation, const Quaternion& rotation) override
    Parameters
    Vector3 translation

    The translation vector.

    Quaternion rotation

    The rotation quaternion.

    Overrides
    Actor::AddMovement(const Vector3& translation, const Quaternion& rotation)

    AddRelativeForce(const Vector3& force, ForceMode mode=ForceMode::Force)

    Applies a force (or impulse) defined in the local space of the rigidbody (relative to its coordinate system) at its center of mass.

    This will not induce any torque

    ForceMode determines if the force is to be conventional or impulsive.

    Each actor has an acceleration and a velocity change accumulator which are directly modified using the modes ForceMode::Acceleration and ForceMode::VelocityChange respectively. The modes ForceMode::Force and ForceMode::Impulse also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse mass and then using ForceMode::Acceleration and ForceMode::VelocityChange respectively.

    Declaration
    public void AddRelativeForce(const Vector3& force, ForceMode mode=ForceMode::Force) const
    Parameters
    Vector3 force

    The force/impulse to apply defined in the local space.

    ForceMode mode

    The mode to use when applying the force/impulse.

    AddRelativeTorque(const Vector3& torque, ForceMode mode=ForceMode::Force)

    Applies an impulsive torque defined in the local space of the rigidbody (relative to its coordinate system).

    ForceMode determines if the force is to be conventional or impulsive.

    Each actor has an angular acceleration and an angular velocity change accumulator which are directly modified using the modes ForceMode::Acceleration and ForceMode::VelocityChange respectively.The modes ForceMode::Force and ForceMode::Impulse also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse inertia and then using ForceMode::Acceleration and ForceMode::VelocityChange respectively.

    Declaration
    public void AddRelativeTorque(const Vector3& torque, ForceMode mode=ForceMode::Force) const
    Parameters
    Vector3 torque

    The torque to apply defined in the local space.

    ForceMode mode

    The mode to use when applying the force/impulse.

    AddTorque(const Vector3& torque, ForceMode mode=ForceMode::Force)

    Applies an impulsive torque defined in the world space to the rigidbody.

    ForceMode determines if the force is to be conventional or impulsive.

    Each actor has an angular acceleration and an angular velocity change accumulator which are directly modified using the modes ForceMode::Acceleration and ForceMode::VelocityChange respectively.The modes ForceMode::Force and ForceMode::Impulse also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse inertia and then using ForceMode::Acceleration and ForceMode::VelocityChange respectively.

    Declaration
    public void AddTorque(const Vector3& torque, ForceMode mode=ForceMode::Force) const
    Parameters
    Vector3 torque

    The torque to apply defined in the world space.

    ForceMode mode

    The mode to use when applying the force/impulse.

    BeginPlay(SceneBeginData* data)

    Called when adding object to the game.

    Declaration
    protected virtual void BeginPlay(SceneBeginData* data) override
    Parameters
    SceneBeginData data

    The initialization data (e.g. used to collect joints to link after begin).

    Overrides
    Actor::BeginPlay(SceneBeginData* data)

    ClosestPoint(const Vector3& position, Vector3& result)

    Gets a point on one of the colliders attached to the attached that is closest to a given location. Can be used to find a hit location or position to apply explosion force or any other special effects.

    Declaration
    public void ClosestPoint(const Vector3& position, Vector3& result) const
    Parameters
    Vector3 position

    The position to find the closest point to it.

    Vector3 result

    The result point on the rigidbody shape that is closest to the specified location.

    Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

    Deserializes object from the input stream.

    Declaration
    public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
    Parameters
    DeserializeStream stream

    The input stream.

    ISerializeModifier modifier

    The deserialization modifier object. Always valid.

    Overrides
    Actor::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

    EndPlay()

    Called when removing object from the game.

    Declaration
    protected virtual void EndPlay() override
    Overrides
    Actor::EndPlay()

    GetAngularDamping()

    Gets the 'drag' force added to reduce angular movement. Angular damping can be used to slow down the rotation of an object. The higher the drag the more the rotation slows down.

    Declaration
    public float GetAngularDamping() const
    Returns
    float

    GetAngularVelocity()

    Gets the angular velocity of the rigidbody measured in radians per second.

    It's used mostly to get the current angular velocity. Manual modifications may result in unrealistic behaviour.

    Declaration
    public Vector3 GetAngularVelocity() const
    Returns
    Vector3

    GetCenterOfMass()

    Gets the center of the mass in the local space.

    Declaration
    public Vector3 GetCenterOfMass() const
    Returns
    Vector3

    GetCenterOfMassOffset()

    Gets the user specified offset for the center of mass of this object, from the calculated location.

    Declaration
    public Float3 GetCenterOfMassOffset() const
    Returns
    Float3

    GetColliders(Array<ColliderType* , AllocationType>& result)

    Declaration
    public void GetColliders(Array<ColliderType* , AllocationType>& result) const
    Parameters
    Array<ColliderType , AllocationType> result

    Type Parameters
    typename ColliderType

    typename AllocationType

    GetConstraints()

    Gets the object movement constraint flags that define degrees of freedom are allowed for the simulation of object.

    Declaration
    public RigidbodyConstraints GetConstraints() const
    Returns
    RigidbodyConstraints

    GetEnableGravity()

    If object should have the force of gravity applied.

    Declaration
    public bool GetEnableGravity() const
    Returns
    bool

    GetEnableSimulation()

    If true simulation and collisions detection will be enabled for the rigidbody.

    Declaration
    public bool GetEnableSimulation() const
    Returns
    bool

    GetIsKinematic()

    Enables kinematic mode for the rigidbody. Kinematic rigidbodies are special dynamic actors that are not influenced by forces(such as gravity), and have no momentum. They are considered to have infinite mass and can push regular dynamic actors out of the way. Kinematics will not collide with static or other kinematic objects but are great for moving platforms or characters, where direct motion control is desired.

    Declaration
    public bool GetIsKinematic() const
    Returns
    bool

    GetLinearDamping()

    Gets the 'drag' force added to reduce linear movement. Linear damping can be used to slow down an object. The higher the drag the more the object slows down.

    Declaration
    public float GetLinearDamping() const
    Returns
    float

    GetLinearVelocity()

    Gets the linear velocity of the rigidbody.

    It's used mostly to get the current velocity. Manual modifications may result in unrealistic behaviour.

    Declaration
    public Vector3 GetLinearVelocity() const
    Returns
    Vector3

    GetMass()

    Gets the mass value measured in kilograms (use override value only if OverrideMass is checked).

    Declaration
    public float GetMass() const
    Returns
    float

    GetMassScale()

    Gets the per-instance scaling of the mass.

    Declaration
    public float GetMassScale() const
    Returns
    float

    GetMaxAngularVelocity()

    Gets the maximum angular velocity that a simulated object can achieve. The angular velocity of rigidbodies is clamped to MaxAngularVelocity to avoid numerical instability with fast rotating bodies. Because this may prevent intentional fast rotations on objects such as wheels, you can override this value per rigidbody.

    Declaration
    public float GetMaxAngularVelocity() const
    Returns
    float

    GetMaxDepenetrationVelocity()

    Gets the maximum depenetration velocity when rigidbody moving out of penetrating state.

    This value controls how much velocity the solver can introduce to correct for penetrations in contacts. Using this property can smooth objects moving out of colliding state and prevent unstable motion.

    Declaration
    public float GetMaxDepenetrationVelocity() const
    Returns
    float

    The value

    GetOverrideMass()

    Override the auto computed mass.

    Declaration
    public bool GetOverrideMass() const
    Returns
    bool

    GetPhysicsActor()

    Gets the native physics backend object.

    Declaration
    public virtual void* GetPhysicsActor() const override
    Returns
    void

    Overrides
    IPhysicsActor::GetPhysicsActor()

    GetSleepThreshold()

    Gets the mass-normalized kinetic energy threshold below which an actor may go to sleep.

    Actors whose kinetic energy divided by their mass is below this threshold will be candidates for sleeping.

    Declaration
    public float GetSleepThreshold() const
    Returns
    float

    The value

    GetStartAwake()

    If object should start awake, or if it should initially be sleeping.

    Declaration
    public bool GetStartAwake() const
    Returns
    bool

    GetUpdateMassWhenScaleChanges()

    If true, it will update mass when actor scale changes.

    Declaration
    public bool GetUpdateMassWhenScaleChanges() const
    Returns
    bool

    GetUseCCD()

    If true Continuous Collision Detection (CCD) will be used for this component.

    Declaration
    public bool GetUseCCD() const
    Returns
    bool

    IsSleeping()

    Determines whether this rigidbody is sleeping.

    Declaration
    public bool IsSleeping() const
    Returns
    bool

    OnActiveInTreeChanged()

    Called when actor active in tree state gets changed.

    Declaration
    protected virtual void OnActiveInTreeChanged() override
    Overrides
    Actor::OnActiveInTreeChanged()

    OnActiveTransformChanged()

    Called when actor's active transformation gets changed after the physics simulation step during.

    This event is called internally by the Physics service and should not be used by the others.

    Declaration
    public virtual void OnActiveTransformChanged() override
    Overrides
    IPhysicsActor::OnActiveTransformChanged()

    OnColliderChanged(Collider* c)

    Declaration
    public virtual void OnColliderChanged(Collider* c)
    Parameters
    Collider c

    OnCollisionEnter(const Collision& c)

    Declaration
    public void OnCollisionEnter(const Collision& c)
    Parameters
    Collision c

    OnCollisionExit(const Collision& c)

    Declaration
    public void OnCollisionExit(const Collision& c)
    Parameters
    Collision c

    OnPhysicsSceneChanged(PhysicsScene* previous)

    Declaration
    protected virtual void OnPhysicsSceneChanged(PhysicsScene* previous) override
    Parameters
    PhysicsScene previous

    Overrides
    Actor::OnPhysicsSceneChanged(PhysicsScene* previous)

    OnTransformChanged()

    Called when actor transform gets changed.

    Declaration
    protected virtual void OnTransformChanged() override
    Overrides
    Actor::OnTransformChanged()

    OnTriggerEnter(PhysicsColliderActor* c)

    Declaration
    public void OnTriggerEnter(PhysicsColliderActor* c)
    Parameters
    PhysicsColliderActor c

    OnTriggerExit(PhysicsColliderActor* c)

    Declaration
    public void OnTriggerExit(PhysicsColliderActor* c)
    Parameters
    PhysicsColliderActor c

    Serialize(SerializeStream& stream, const void* otherObj)

    Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.

    Declaration
    public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
    Parameters
    SerializeStream stream

    The output stream.

    void otherObj

    The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties.

    Overrides
    Actor::Serialize(SerializeStream& stream, const void* otherObj)

    SetAngularDamping(float value)

    Sets the 'drag' force added to reduce angular movement. Angular damping can be used to slow down the rotation of an object. The higher the drag the more the rotation slows down.

    Declaration
    public void SetAngularDamping(float value)
    Parameters
    float value

    The value.

    SetAngularVelocity(const Vector3& value)

    Sets the angular velocity of the rigidbody measured in radians per second.

    It's used mostly to get the current angular velocity. Manual modifications may result in unrealistic behaviour.

    Declaration
    public void SetAngularVelocity(const Vector3& value) const
    Parameters
    Vector3 value

    The value.

    SetCenterOfMassOffset(const Float3& value)

    Sets the user specified offset for the center of mass of this object, from the calculated location.

    Declaration
    public void SetCenterOfMassOffset(const Float3& value)
    Parameters
    Float3 value

    SetConstraints(const RigidbodyConstraints value)

    Sets the object movement constraint flags that define degrees of freedom are allowed for the simulation of object.

    Declaration
    public void SetConstraints(const RigidbodyConstraints value)
    Parameters
    RigidbodyConstraints value

    SetEnableGravity(bool value)

    If object should have the force of gravity applied.

    Declaration
    public void SetEnableGravity(bool value)
    Parameters
    bool value

    SetEnableSimulation(bool value)

    If true simulation and collisions detection will be enabled for the rigidbody.

    Declaration
    public void SetEnableSimulation(bool value)
    Parameters
    bool value

    SetIsKinematic(const bool value)

    Enables kinematic mode for the rigidbody. Kinematic rigidbodies are special dynamic actors that are not influenced by forces(such as gravity), and have no momentum. They are considered to have infinite mass and can push regular dynamic actors out of the way. Kinematics will not collide with static or other kinematic objects but are great for moving platforms or characters, where direct motion control is desired.

    Declaration
    public void SetIsKinematic(const bool value)
    Parameters
    bool value

    SetLinearDamping(float value)

    Sets the 'drag' force added to reduce linear movement. Linear damping can be used to slow down an object. The higher the drag the more the object slows down.

    Declaration
    public void SetLinearDamping(float value)
    Parameters
    float value

    SetLinearVelocity(const Vector3& value)

    Sets the linear velocity of the rigidbody.

    It's used mostly to get the current velocity. Manual modifications may result in unrealistic behaviour.

    Declaration
    public void SetLinearVelocity(const Vector3& value) const
    Parameters
    Vector3 value

    The value.

    SetMass(float value)

    Sets the mass value measured in kilograms (use override value only if OverrideMass is checked).

    Declaration
    public void SetMass(float value)
    Parameters
    float value

    SetMassScale(float value)

    Sets the per-instance scaling of the mass.

    Declaration
    public void SetMassScale(float value)
    Parameters
    float value

    SetMaxAngularVelocity(float value)

    Sets the maximum angular velocity that a simulated object can achieve. The angular velocity of rigidbodies is clamped to MaxAngularVelocity to avoid numerical instability with fast rotating bodies. Because this may prevent intentional fast rotations on objects such as wheels, you can override this value per rigidbody.

    Declaration
    public void SetMaxAngularVelocity(float value)
    Parameters
    float value

    SetMaxDepenetrationVelocity(const float value)

    Sets the maximum depenetration velocity when rigidbody moving out of penetrating state.

    This value controls how much velocity the solver can introduce to correct for penetrations in contacts. Using this property can smooth objects moving out of colliding state and prevent unstable motion.

    Declaration
    public void SetMaxDepenetrationVelocity(const float value) const
    Parameters
    float value

    The value.

    SetOverrideMass(bool value)

    Override the auto computed mass.

    Declaration
    public void SetOverrideMass(bool value)
    Parameters
    bool value

    SetSleepThreshold(const float value)

    Sets the mass-normalized kinetic energy threshold below which an actor may go to sleep.

    Actors whose kinetic energy divided by their mass is below this threshold will be candidates for sleeping.

    Declaration
    public void SetSleepThreshold(const float value) const
    Parameters
    float value

    The value.

    SetSolverIterationCounts(int32 minPositionIters, int32 minVelocityIters)

    Sets the solver iteration counts for the rigidbody.

    The solver iteration count determines how accurately joints and contacts are resolved. If you are having trouble with jointed bodies oscillating and behaving erratically, then setting a higher position iteration count may improve their stability.

    If intersecting bodies are being depenetrated too violently, increase the number of velocity iterations. More velocity iterations will drive the relative exit velocity of the intersecting objects closer to the correct value given the restitution.

    Default: 4 position iterations, 1 velocity iteration.

    Declaration
    public void SetSolverIterationCounts(int32 minPositionIters, int32 minVelocityIters) const
    Parameters
    int32 minPositionIters

    The minimum number of position iterations the solver should perform for this body.

    int32 minVelocityIters

    The minimum number of velocity iterations the solver should perform for this body.

    SetStartAwake(bool value)

    If object should start awake, or if it should initially be sleeping.

    Declaration
    public void SetStartAwake(bool value)
    Parameters
    bool value

    SetUpdateMassWhenScaleChanges(bool value)

    If true, it will update mass when actor scale changes.

    Declaration
    public void SetUpdateMassWhenScaleChanges(bool value)
    Parameters
    bool value

    SetUseCCD(const bool value)

    If true Continuous Collision Detection (CCD) will be used for this component.

    Declaration
    public void SetUseCCD(const bool value)
    Parameters
    bool value

    Sleep()

    Forces a rigidbody to sleep (for at least one frame).

    Declaration
    public void Sleep() const

    UpdateBounds()

    Updates the bounding box.

    Declaration
    public void UpdateBounds()

    UpdateMass()

    Updates the actor's mass (auto calculated mass from density and inertia tensor or overriden value).

    Declaration
    public void UpdateMass()

    UpdateScale()

    Updates the rigidbody scale dependent properties like mass (may be modified when actor transformation changes).

    Declaration
    public void UpdateScale()

    WakeUp()

    Forces a rigidbody to wake up.

    Declaration
    public void WakeUp() const

    See Also

    Actor
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat