Search Results for

    Show / Hide Table of Contents

    Class Joint

    A base class for all Joint types. Joints constrain how two rigidbodies move relative to one another (for example a door hinge). One of the bodies in the joint must always be movable (non-kinematic and non-static).

    Joint constraint is created between the parent physic actor (rigidbody, character controller, etc.) and the specified target actor.

    Inheritance
    Object
    ScriptingObject
    SceneObject
    Actor
    Joint
    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::AddMovement(const Vector3& translation, const Quaternion& rotation)
    Actor::AddScript()
    Actor::AddStaticFlags(StaticFlags flags)
    Actor::AddTag(const Tag& tag)
    Actor::AddTagRecursive(const Tag& tag)
    Joint
    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)
    Joint
    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::OnDeleteObject()
    Actor::OnEndPlay()
    Actor::OnLayerChanged()
    ScriptingObject::OnManagedInstanceDeleted()
    Actor::OnOrderInParentChanged()
    Actor::OnPhysicsSceneChanged(PhysicsScene* previous)
    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
    Joint
    Joint
    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)
    Joint
    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()
    ISerializable::~ISerializable()
    Object::~Object()
    SceneObject::~SceneObject()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Physics/Joints/Joint.h
    Syntax
    public class Joint : public Actor

    Fields

    _breakForce

    Declaration
    protected float _breakForce
    Field Value
    float

    _breakTorque

    Declaration
    protected float _breakTorque
    Field Value
    float

    _enableAutoAnchor

    Declaration
    protected bool _enableAutoAnchor = false
    Field Value
    bool

    _enableCollision

    Declaration
    protected bool _enableCollision = true
    Field Value
    bool

    _joint

    Declaration
    protected void* _joint
    Field Value
    void

    _targetAnchor

    Declaration
    protected Vector3 _targetAnchor
    Field Value
    Vector3

    _targetAnchorRotation

    Declaration
    protected Quaternion _targetAnchorRotation
    Field Value
    Quaternion

    JointBreak

    Occurs when a joint gets broken during simulation.

    Declaration
    public Action JointBreak
    Field Value
    Action

    Target

    The target actor for the joint. It has to be IPhysicsActor type (eg. RigidBody or CharacterController).

    Declaration
    public ScriptingObjectReference<Actor> Target
    Field Value
    ScriptingObjectReference<Actor>

    Methods

    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)

    Create()

    Creates native join object.

    Declaration
    public void Create()

    CreateJoint(const struct PhysicsJointDesc& desc)

    Declaration
    protected virtual void* CreateJoint(const struct PhysicsJointDesc& desc) = 0
    Parameters
    struct PhysicsJointDesc desc

    Returns
    void

    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)

    DrawPhysicsDebug(RenderView& view)

    Declaration
    protected virtual void DrawPhysicsDebug(RenderView& view)
    Parameters
    RenderView view

    EndPlay()

    Called when removing object from the game.

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

    GetBreakForce()

    Gets the break force. Determines the maximum force the joint can apply before breaking. Broken joints no longer participate in physics simulation.

    Declaration
    public float GetBreakForce() const
    Returns
    float

    GetBreakTorque()

    Gets the break torque. Determines the maximum torque the joint can apply before breaking. Broken joints no longer participate in physics simulation.

    Declaration
    public float GetBreakTorque() const
    Returns
    float

    GetCurrentForce(Vector3& linear, Vector3& angular)

    Gets the current force applied by the solver to maintain all constraints.

    Declaration
    public void GetCurrentForce(Vector3& linear, Vector3& angular) const
    Parameters
    Vector3 linear

    The result linear force.

    Vector3 angular

    The result angular force.

    GetEnableAutoAnchor()

    Determines whether use automatic target anchor position and rotation based on the joint world-space frame (computed when creating joint).

    Declaration
    public bool GetEnableAutoAnchor() const
    Returns
    bool

    GetEnableCollision()

    Determines whether collision between the two bodies managed by the joint are enabled.

    Declaration
    public bool GetEnableCollision() const
    Returns
    bool

    GetPhysicsImpl()

    Gets the native physics backend object.

    Declaration
    public void* GetPhysicsImpl() const
    Returns
    void

    GetTargetAnchor()

    Gets the target anchor.

    This is the relative pose which locates the joint frame relative to the target actor.

    Declaration
    public Vector3 GetTargetAnchor() const
    Returns
    Vector3

    GetTargetAnchorRotation()

    Gets the target anchor rotation.

    This is the relative pose rotation which locates the joint frame relative to the target actor.

    Declaration
    public Quaternion GetTargetAnchorRotation() const
    Returns
    Quaternion

    GetTargetOrientation()

    Declaration
    protected Quaternion GetTargetOrientation() const
    Returns
    Quaternion

    GetTargetPosition()

    Declaration
    protected Vector3 GetTargetPosition() const
    Returns
    Vector3

    OnActiveInTreeChanged()

    Called when actor active in tree state gets changed.

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

    OnDebugDrawSelected()

    Draws debug shapes for the selected actor and all child scripts.

    Declaration
    public virtual void OnDebugDrawSelected() override
    Overrides
    Actor::OnDebugDrawSelected()

    OnDisable()

    Called when actor gets removed from game systems. Occurs on EndPlay event or when actor gets inactivated in hierarchy. Use this event to unregister object from other game system (eg. audio).

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

    OnEnable()

    Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio).

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

    OnJointBreak()

    Called by the physics system when joint gets broken.

    Declaration
    public virtual void OnJointBreak()

    OnParentChanged()

    Called when actor parent gets changed.

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

    OnTransformChanged()

    Called when actor transform gets changed.

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

    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)

    SetBreakForce(float value)

    Sets the break force. Determines the maximum force the joint can apply before breaking. Broken joints no longer participate in physics simulation.

    Declaration
    public void SetBreakForce(float value)
    Parameters
    float value

    SetBreakTorque(float value)

    Sets the break torque. Determines the maximum torque the joint can apply before breaking. Broken joints no longer participate in physics simulation.

    Declaration
    public void SetBreakTorque(float value)
    Parameters
    float value

    SetEnableAutoAnchor(bool value)

    Determines whether use automatic target anchor position and rotation based on the joint world-space frame (computed when creating joint).

    Declaration
    public void SetEnableAutoAnchor(bool value)
    Parameters
    bool value

    SetEnableCollision(bool value)

    Determines whether collision between the two bodies managed by the joint are enabled.

    Declaration
    public void SetEnableCollision(bool value)
    Parameters
    bool value

    SetJointLocation(const Vector3& location)

    Sets the location of the joint by automatically computing local position and target anchor to place a joint at the given location (world-space).

    Use this utility to automatically place joint at the given location after setting up joint parent and target.

    Declaration
    public void SetJointLocation(const Vector3& location)
    Parameters
    Vector3 location

    The joint location to set (world-space).

    SetJointOrientation(const Quaternion& orientation)

    Sets the orientation of the joint by automatically computing local orientation and target anchor orientation to orient a joint at the given rotation (world-space).

    Use this utility to automatically rotate joint at the given location after setting up joint parent and target.

    Declaration
    public void SetJointOrientation(const Quaternion& orientation)
    Parameters
    Quaternion orientation

    The joint orientation to set (world-space).

    SetTargetAnchor(const Vector3& value)

    Sets the target anchor.

    This is the relative pose which locates the joint frame relative to the target actor.

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

    SetTargetAnchorRotation(const Quaternion& value)

    Sets the target anchor rotation.

    This is the relative pose rotation which locates the joint frame relative to the target actor.

    Declaration
    public void SetTargetAnchorRotation(const Quaternion& value)
    Parameters
    Quaternion value

    See Also

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