Class PredictionRigidbody
Inheritance
System.Object
PredictionRigidbody
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 PredictionRigidbody : IResettable
Properties
HasPendingForces
Returns if there are any pending forces.
Declaration
public bool HasPendingForces { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Rigidbody
Rigidbody which force is applied.
Declaration
public Rigidbody Rigidbody { get; }
Property Value
Type | Description |
---|---|
UnityEngine.Rigidbody |
Methods
AddExplosiveForce(Single, Vector3, Single, Single, ForceMode)
Declaration
public void AddExplosiveForce(float force, Vector3 position, float radius, float upwardsModifier = 0F, ForceMode mode = ForceMode.Force)
Parameters
Type | Name | Description |
---|---|---|
System.Single | force | |
UnityEngine.Vector3 | position | |
System.Single | radius | |
System.Single | upwardsModifier | |
UnityEngine.ForceMode | mode |
AddForce(Vector3, ForceMode)
Adds Velocity force to the Rigidbody.
Declaration
public void AddForce(Vector3 force, ForceMode mode = ForceMode.Force)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | force | |
UnityEngine.ForceMode | mode |
AddForceAtPosition(Vector3, Vector3, ForceMode)
Declaration
public void AddForceAtPosition(Vector3 force, Vector3 position, ForceMode mode = ForceMode.Force)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | force | |
UnityEngine.Vector3 | position | |
UnityEngine.ForceMode | mode |
AddRelativeForce(Vector3, ForceMode)
Declaration
public void AddRelativeForce(Vector3 force, ForceMode mode = ForceMode.Force)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | force | |
UnityEngine.ForceMode | mode |
AddRelativeTorque(Vector3, ForceMode)
Declaration
public void AddRelativeTorque(Vector3 force, ForceMode mode = ForceMode.Force)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | force | |
UnityEngine.ForceMode | mode |
AddTorque(Vector3, ForceMode)
Declaration
public void AddTorque(Vector3 force, ForceMode mode = ForceMode.Force)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | force | |
UnityEngine.ForceMode | mode |
AngularVelocity(Vector3)
Sets angularVelocity while clearning pending forces. Simulate should still be called normally.
Declaration
public void AngularVelocity(Vector3 force)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | 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<PredictionRigidbody.EntryData> GetPendingForces()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<PredictionRigidbody.EntryData> |
Initialize(Rigidbody)
Rigidbody which force is applied.
Declaration
public void Initialize(Rigidbody rb)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Rigidbody | rb |
InitializeState()
Declaration
public void InitializeState()
Reconcile(PredictionRigidbody)
Reconciles to a state.
Declaration
public void Reconcile(PredictionRigidbody pr)
Parameters
Type | Name | Description |
---|---|---|
PredictionRigidbody | 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 |