Class PhysicsAdaptor

    Definition

    Namespace:
    Tizen.NUI.Physics2D
    Assembly:
    Tizen.NUI.Physics2D.dll

    Adaptor to manage access to the physics world and pairing actors and physics bodies, plus some translation methods to/from the physics space and dali space.

    Also manages a debug renderer that may utilize the physics engine debug. It is up to the developer to retrieve the root actor and parent it into the scene.

    public class PhysicsAdaptor : BaseHandle, IDynamicResourceHandler, INameScope, System.IDisposable
    Inheritance
    object
    BindableObject
    Element
    BaseHandle
    PhysicsAdaptor
    Implements
    IDynamicResourceHandler
    INameScope
    System.IDisposable

    Constructors

    View Source

    PhysicsAdaptor(Matrix, Vector2)

    Initialize the physics system.

    Transformation matrix from NUI space to the Physics Space Size of the root layer that the adaptor creates
    Declaration
    public PhysicsAdaptor(Matrix transform, Vector2 size)
    Parameters
    Type Name Description
    Matrix transform
    Vector2 size
    View Source

    PhysicsAdaptor(PhysicsAdaptor)

    Copy Constructor

    Declaration
    public PhysicsAdaptor(PhysicsAdaptor adaptor)
    Parameters
    Type Name Description
    PhysicsAdaptor adaptor

    Properties

    View Source

    DebugState

    Property to handle the debug state of the adaptor

    Declaration
    public DebugState DebugState { get; set; }
    Property Value
    Type Description
    DebugState
    View Source

    IntegrationState

    Property to handle the IntegrationState of the adaptor

    Declaration
    public IntegrationState IntegrationState { get; set; }
    Property Value
    Type Description
    IntegrationState
    View Source

    Timestep

    The time that the integration step notionally takes.

    Declaration
    public float Timestep { get; set; }
    Property Value
    Type Description
    float

    Methods

    View Source

    AddViewToBody(View, Body)

    Add a view to the body. The view will be used to render the body. It is parented onto the root layer. The physics body should be added to the physics space by the user.

    Declaration
    public PhysicsActor AddViewToBody(View view, Body body)
    Parameters
    Type Name Description
    View view
    Body body
    Returns
    Type Description
    PhysicsActor
    View Source

    BuildPickingRay(Vector3, Vector3, Vector3, Vector3)

    Convert a touch point into a picking ray in the Physics space.

    Declaration
    public void BuildPickingRay(Vector3 origin, Vector3 direction, Vector3 rayFromWorld, Vector3 rayToWorld)
    Parameters
    Type Name Description
    Vector3 origin
    Vector3 direction
    Vector3 rayFromWorld
    Vector3 rayToWorld
    View Source

    ConvertVectorFromPhysicsSpace(Vector3)

    Converts a vector (not a point) in physics space to NUI space.

    Declaration
    public Vector3 ConvertVectorFromPhysicsSpace(Vector3 vector)
    Parameters
    Type Name Description
    Vector3 vector
    Returns
    Type Description
    Vector3
    View Source

    ConvertVectorToPhysicsSpace(Vector3)

    Converts a vector (not a point) in NUI space to Physics space

    Declaration
    public Vector3 ConvertVectorToPhysicsSpace(Vector3 vector)
    Parameters
    Type Name Description
    Vector3 vector
    Returns
    Type Description
    Vector3
    View Source

    CreateDebugLayer(Window)

    The debug layer uses a drawable actor and the debug features of the native physics engine to render any debug graphics for the physics bodies. This layer needs to be created before setting the DebugState has any effect.

    Declaration
    public Layer CreateDebugLayer(Window window)
    Parameters
    Type Name Description
    Window window
    Returns
    Type Description
    Layer
    View Source

    CreateSyncPoint()

    A sync point is necessary to synchronize Async calls in the update thread. Any use of the PhysicsActor.AsyncNNN calls will require this API to be called.

    Declaration
    public void CreateSyncPoint()
    View Source

    Dispose(DisposeTypes)

    Dispose the PhysicsAdaptor

    Declaration
    protected override void Dispose(DisposeTypes type)
    Parameters
    Type Name Description
    DisposeTypes type
    Overrides
    BaseHandle.Dispose(DisposeTypes)
    View Source

    GetAccessor()

    Return an accessor to the physics world. Internally, this locks a mutex to prevent the integration step from running, this will also block the Update thread. It is important that this accessor is disposed of when not needed to restart the update thread. (Suggest use of "using" block).

    Declaration
    public ScopedPhysicsAccessor GetAccessor()
    Returns
    Type Description
    ScopedPhysicsAccessor
    View Source

    GetPhysicsActor(Body)

    Retrieve a PhysicsActor given a physics body. If there is no associated PhysicsActor, this will return null.

    Declaration
    public PhysicsActor GetPhysicsActor(Body body)
    Parameters
    Type Name Description
    Body body
    Returns
    Type Description
    PhysicsActor
    View Source

    GetRootLayer()

    Declaration
    public Layer GetRootLayer()
    Returns
    Type Description
    Layer
    View Source

    ProjectPoint(Vector3, Vector3, float)

    Project a point from the origin (in NUI space) a distance along the direction vector (in NUI space) and returns the projected point in physics space.

    Declaration
    public Vector3 ProjectPoint(Vector3 origin, Vector3 direction, float distance)
    Parameters
    Type Name Description
    Vector3 origin
    Vector3 direction
    float distance
    Returns
    Type Description
    Vector3
    View Source

    ReleaseSwigCPtr(HandleRef)

    Declaration
    protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
    Parameters
    Type Name Description
    System.Runtime.InteropServices.HandleRef swigCPtr
    View Source

    RemoveViewFromBody(PhysicsActor)

    This will unparent the View from the root layer, and dis-associate it from the physics body. It is the responsibility of the user to remove the physics body from the world.

    Declaration
    public void RemoveViewFromBody(PhysicsActor actor)
    Parameters
    Type Name Description
    PhysicsActor actor
    View Source

    SetTransformAndSize(Matrix, Vector2)

    Change the transform matrix or the size of the root view

    Declaration
    public void SetTransformAndSize(Matrix transform, Vector2 size)
    Parameters
    Type Name Description
    Matrix transform
    Vector2 size
    View Source

    TransformPositionFromPhysicsSpace(Vector3)

    Transform a position in Physics space to NUI space

    Declaration
    public Vector3 TransformPositionFromPhysicsSpace(Vector3 position)
    Parameters
    Type Name Description
    Vector3 position
    Returns
    Type Description
    Vector3
    View Source

    TransformPositionToPhysicsSpace(Vector3)

    Transforms a position from NUI space to physics space

    Declaration
    public Vector3 TransformPositionToPhysicsSpace(Vector3 position)
    Parameters
    Type Name Description
    Vector3 position
    Returns
    Type Description
    Vector3
    View Source

    TransformRotationFromPhysicsSpace(Rotation)

    Convert a rotation in physics space into NUI space

    Declaration
    public Rotation TransformRotationFromPhysicsSpace(Rotation rotation)
    Parameters
    Type Name Description
    Rotation rotation
    Returns
    Type Description
    Rotation
    View Source

    TransformRotationToPhysicsSpace(Rotation)

    Transform a rotation from NUI to physics space

    Declaration
    public Rotation TransformRotationToPhysicsSpace(Rotation rotation)
    Parameters
    Type Name Description
    Rotation rotation
    Returns
    Type Description
    Rotation

    Implements

    IDynamicResourceHandler
    INameScope
    System.IDisposable

    Extension Methods

    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX