Class PredictionRigidbody2D
Inheritance
System.Object
PredictionRigidbody2D
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: FishNet.Object.Prediction
Assembly: FishNet.Runtime.dll
Syntax
[Preserve]
public class PredictionRigidbody2D : IResettable
Properties
HasPendingForces
Returns if there are any pending forces.
Declaration
public bool HasPendingForces { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Rigidbody2D
Rigidbody which force is applied.
Declaration
public Rigidbody2D Rigidbody2D { get; }
Property Value
Type | Description |
---|---|
UnityEngine.Rigidbody2D |
Methods
AddForce(Vector3, ForceMode2D)
Adds Velocity force to the Rigidbody.
Declaration
public void AddForce(Vector3 force, ForceMode2D mode = ForceMode2D.Force)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | force | |
UnityEngine.ForceMode2D | mode |
AddForceAtPosition(Vector3, Vector3, ForceMode2D)
Declaration
public void AddForceAtPosition(Vector3 force, Vector3 position, ForceMode2D mode = ForceMode2D.Force)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | force | |
UnityEngine.Vector3 | position | |
UnityEngine.ForceMode2D | mode |
AddRelativeForce(Vector3, ForceMode2D)
Declaration
public void AddRelativeForce(Vector3 force, ForceMode2D mode = ForceMode2D.Force)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | force | |
UnityEngine.ForceMode2D | mode |
AddTorque(Single, ForceMode2D)
Declaration
public void AddTorque(float force, ForceMode2D mode = ForceMode2D.Force)
Parameters
Type | Name | Description |
---|---|---|
System.Single | force | |
UnityEngine.ForceMode2D | mode |
AngularVelocity(Single)
Sets angularVelocity while clearning pending forces. Simulate should still be called normally.
Declaration
public void AngularVelocity(float force)
Parameters
Type | Name | Description |
---|---|---|
System.Single | force |
ClearPendingForces()
Clears pending velocity and angular velocity forces.
Declaration
public void ClearPendingForces()
ClearPendingForces(Boolean)
Manually clears pending forces.
Declaration
public void ClearPendingForces(bool velocity)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | velocity | True to clear velocities, false to clear angular velocities. |
Finalize()
Declaration
protected void Finalize()
GetPendingForces()
Returns current pending forces. Modifying this collection could cause undesirable results.
Declaration
public List<PredictionRigidbody2D.EntryData> GetPendingForces()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<PredictionRigidbody2D.EntryData> |
Initialize(Rigidbody2D)
Rigidbody which force is applied.
Declaration
public void Initialize(Rigidbody2D rb)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Rigidbody2D | rb |
InitializeState()
Declaration
public void InitializeState()
Reconcile(PredictionRigidbody2D)
Reconciles to a state.
Declaration
public void Reconcile(PredictionRigidbody2D pr)
Parameters
Type | Name | Description |
---|---|---|
PredictionRigidbody2D | pr |
ResetState()
Declaration
public void ResetState()
Simulate()
Applies pending forces to rigidbody in the order they were added.
Declaration
public void Simulate()
Velocity(Vector3)
Sets velocity while clearing pending forces. Simulate should still be called normally.
Declaration
public void Velocity(Vector3 force)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | force |