Class PhysicsActor
Definition
- Assembly:
- Tizen.NUI.Physics2D.dll
Class to associate a physics body (such as btRigidBody*) with a View for rendering.
This object offers methods to modify basic physics properties asynchronously, that is, on the Update thread.
Currently, using the Physics API directly should be done after blocking the physics integration step, by getting a ScopedAccessor from the PhysicsAdaptor. Once the ScopedAccessor is disposed, then the physics integration will run again.
public class PhysicsActor : BaseHandle, IDynamicResourceHandler, INameScope, System.IDisposable
- Inheritance
- Implements
-
System.IDisposable
Constructors
View SourcePhysicsActor(View, Body, PhysicsAdaptor)
Binds the actor to the given body. This should be a body that has been added to the physics world, and has physical postion and rotation in that space. The Actor is used to render that object in DALi space.
Declaration
public PhysicsActor(View view, Body body, PhysicsAdaptor adaptor)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | |
| Body | body | |
| PhysicsAdaptor | adaptor |
PhysicsActor(PhysicsActor)
Copy Constructor
Declaration
public PhysicsActor(PhysicsActor adaptor)
Parameters
| Type | Name | Description |
|---|---|---|
| PhysicsActor | adaptor |
Properties
View SourceView
View is the view used for rendering the associated physics body.
Declaration
public View View { get; }
Property Value
| Type | Description |
|---|---|
| View |
Methods
View SourceAsyncSetPhysicsPosition(Vector3)
Queue a method to set the position on the associated physics body in the update thread before the next integration.
Declaration
public void AsyncSetPhysicsPosition(Vector3 position)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position |
AsyncSetPhysicsRotation(Rotation)
Queue a method to set the rotation of the associated physics body in the update thread before the next integration.
Declaration
public void AsyncSetPhysicsRotation(Rotation position)
Parameters
| Type | Name | Description |
|---|---|---|
| Rotation | position |
Dispose(DisposeTypes)
Dispose the physics actor This will release the View, but it's up to the caller to release the Body.
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
| Type | Name | Description |
|---|---|---|
| DisposeTypes | type |
Overrides
View SourceGetActorPosition()
Get the current position of the View in world space
Declaration
public Vector3 GetActorPosition()
Returns
| Type | Description |
|---|---|
| Vector3 |
GetActorRotation()
Get the current rotation of the View in world space
Declaration
public Rotation GetActorRotation()
Returns
| Type | Description |
|---|---|
| Rotation |
GetBody()
Get the physics body associated with this physics actor
Declaration
public Body GetBody()
Returns
| Type | Description |
|---|---|
| Body |
GetPhysicsPosition()
Get the current position of the physics body in Physics space.
Declaration
public Vector3 GetPhysicsPosition()
Returns
| Type | Description |
|---|---|
| Vector3 |
GetPhysicsRotation()
Get the current rotation of the physics body in Physics space.
Declaration
public Rotation GetPhysicsRotation()
Returns
| Type | Description |
|---|---|
| Rotation |
ReleaseSwigCPtr(HandleRef)
Declaration
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.InteropServices.HandleRef | swigCPtr |