Struct CollisionWorld
Syntax
[NoAlias]
public struct CollisionWorld : ICollidable, IDisposable
Constructors
CollisionWorld(Int32, Int32)
Declaration
public CollisionWorld(int numStaticBodies, int numDynamicBodies)
Parameters
Type |
Name |
Description |
Int32 |
numStaticBodies |
|
Int32 |
numDynamicBodies |
|
Properties
Bodies
Declaration
public readonly NativeArray<RigidBody> Bodies { get; }
Property Value
CollisionTolerance
Declaration
public readonly float CollisionTolerance { get; }
Property Value
DynamicBodies
Declaration
public readonly NativeArray<RigidBody> DynamicBodies { get; }
Property Value
NumBodies
Declaration
public readonly int NumBodies { get; }
Property Value
NumDynamicBodies
Declaration
public readonly int NumDynamicBodies { get; }
Property Value
NumStaticBodies
Declaration
public readonly int NumStaticBodies { get; }
Property Value
StaticBodies
Declaration
public readonly NativeArray<RigidBody> StaticBodies { get; }
Property Value
Methods
BoxCast(float3, quaternion, float3, float3, Single, out ColliderCastHit, CollisionFilter, QueryInteraction)
Declaration
public bool BoxCast(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, out ColliderCastHit hitInfo, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
BoxCast(float3, quaternion, float3, float3, Single, CollisionFilter, QueryInteraction)
Declaration
public bool BoxCast(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
BoxCastAll(float3, quaternion, float3, float3, Single, ref NativeList<ColliderCastHit>, CollisionFilter, QueryInteraction)
Declaration
public bool BoxCastAll(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, ref NativeList<ColliderCastHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
BoxCastCustom<T>(float3, quaternion, float3, float3, Single, ref T, CollisionFilter, QueryInteraction)
Declaration
public bool BoxCastCustom<T>(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
where T : struct, ICollector<ColliderCastHit>
Parameters
Returns
Type Parameters
Implements
BuildBroadphase(ref PhysicsWorld, Single, float3, Boolean)
Declaration
public void BuildBroadphase(ref PhysicsWorld world, float timeStep, float3 gravity, bool buildStaticTree = true)
Parameters
CalculateAabb()
Declaration
public Aabb CalculateAabb()
Returns
Implements
Declaration
public Aabb CalculateAabb(RigidTransform transform)
Parameters
Returns
Implements
Declaration
public bool CalculateDistance(ColliderDistanceInput input)
Parameters
Returns
Implements
Declaration
public bool CalculateDistance(ColliderDistanceInput input, ref NativeList<DistanceHit> allHits)
Parameters
Returns
Implements
Declaration
public bool CalculateDistance(ColliderDistanceInput input, out DistanceHit closestHit)
Parameters
Returns
Implements
Declaration
public bool CalculateDistance(PointDistanceInput input)
Parameters
Returns
Implements
Declaration
public bool CalculateDistance(PointDistanceInput input, ref NativeList<DistanceHit> allHits)
Parameters
Returns
Implements
Declaration
public bool CalculateDistance(PointDistanceInput input, out DistanceHit closestHit)
Parameters
Returns
Implements
Declaration
public bool CalculateDistance<T>(ColliderDistanceInput input, ref T collector)
where T : struct, ICollector<DistanceHit>
Parameters
Returns
Type Parameters
Implements
Declaration
public bool CalculateDistance<T>(PointDistanceInput input, ref T collector)
where T : struct, ICollector<DistanceHit>
Parameters
Returns
Type Parameters
Implements
CapsuleCast(float3, float3, Single, float3, Single, out ColliderCastHit, CollisionFilter, QueryInteraction)
Declaration
public bool CapsuleCast(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, out ColliderCastHit hitInfo, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
CapsuleCast(float3, float3, Single, float3, Single, CollisionFilter, QueryInteraction)
Declaration
public bool CapsuleCast(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
CapsuleCastAll(float3, float3, Single, float3, Single, ref NativeList<ColliderCastHit>, CollisionFilter, QueryInteraction)
Declaration
public bool CapsuleCastAll(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, ref NativeList<ColliderCastHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
CapsuleCastCustom<T>(float3, float3, Single, float3, Single, ref T, CollisionFilter, QueryInteraction)
Declaration
public bool CapsuleCastCustom<T>(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
where T : struct, ICollector<ColliderCastHit>
Parameters
Returns
Type Parameters
Implements
Declaration
public bool CastCollider(ColliderCastInput input)
Parameters
Returns
Implements
Declaration
public bool CastCollider(ColliderCastInput input, ref NativeList<ColliderCastHit> allHits)
Parameters
Returns
Implements
Declaration
public bool CastCollider(ColliderCastInput input, out ColliderCastHit closestHit)
Parameters
Returns
Implements
Declaration
public bool CastCollider<T>(ColliderCastInput input, ref T collector)
where T : struct, ICollector<ColliderCastHit>
Parameters
Returns
Type Parameters
Implements
Declaration
public bool CastRay(RaycastInput input)
Parameters
Returns
Implements
Declaration
public bool CastRay(RaycastInput input, ref NativeList<RaycastHit> allHits)
Parameters
Returns
Implements
Declaration
public bool CastRay(RaycastInput input, out RaycastHit closestHit)
Parameters
Returns
Implements
Declaration
public bool CastRay<T>(RaycastInput input, ref T collector)
where T : struct, ICollector<RaycastHit>
Parameters
Returns
Type Parameters
Implements
CheckBox(float3, quaternion, float3, CollisionFilter, QueryInteraction)
Declaration
public bool CheckBox(float3 center, quaternion orientation, float3 halfExtents, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
CheckCapsule(float3, float3, Single, CollisionFilter, QueryInteraction)
Declaration
public bool CheckCapsule(float3 point1, float3 point2, float radius, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
CheckSphere(float3, Single, CollisionFilter, QueryInteraction)
Declaration
public bool CheckSphere(float3 position, float radius, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
Clone()
Declaration
public CollisionWorld Clone()
Returns
Dispose()
Declaration
FindOverlaps(ref NativeStream.Writer, ref NativeStream.Writer)
Declaration
public void FindOverlaps(ref NativeStream.Writer dynamicVsDynamicPairsWriter, ref NativeStream.Writer staticVsDynamicPairsWriter)
Parameters
GetRigidBodyIndex(Entity)
Declaration
public int GetRigidBodyIndex(Entity entity)
Parameters
Type |
Name |
Description |
Entity |
entity |
|
Returns
Declaration
public bool OverlapAabb(OverlapAabbInput input, ref NativeList<int> allHits)
Parameters
Returns
OverlapBox(float3, quaternion, float3, ref NativeList<DistanceHit>, CollisionFilter, QueryInteraction)
Declaration
public bool OverlapBox(float3 center, quaternion orientation, float3 halfExtents, ref NativeList<DistanceHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
OverlapBoxCustom<T>(float3, quaternion, float3, ref T, CollisionFilter, QueryInteraction)
Declaration
public bool OverlapBoxCustom<T>(float3 center, quaternion orientation, float3 halfExtents, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
where T : struct, ICollector<DistanceHit>
Parameters
Returns
Type Parameters
Implements
OverlapCapsule(float3, float3, Single, ref NativeList<DistanceHit>, CollisionFilter, QueryInteraction)
Declaration
public bool OverlapCapsule(float3 point1, float3 point2, float radius, ref NativeList<DistanceHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
OverlapCapsuleCustom<T>(float3, float3, Single, ref T, CollisionFilter, QueryInteraction)
Declaration
public bool OverlapCapsuleCustom<T>(float3 point1, float3 point2, float radius, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
where T : struct, ICollector<DistanceHit>
Parameters
Returns
Type Parameters
Implements
OverlapSphere(float3, Single, ref NativeList<DistanceHit>, CollisionFilter, QueryInteraction)
Declaration
public bool OverlapSphere(float3 position, float radius, ref NativeList<DistanceHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
OverlapSphereCustom<T>(float3, Single, ref T, CollisionFilter, QueryInteraction)
Declaration
public bool OverlapSphereCustom<T>(float3 position, float radius, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
where T : struct, ICollector<DistanceHit>
Parameters
Returns
Type Parameters
Implements
Reset(Int32, Int32)
Declaration
public void Reset(int numStaticBodies, int numDynamicBodies)
Parameters
Type |
Name |
Description |
Int32 |
numStaticBodies |
|
Int32 |
numDynamicBodies |
|
ScheduleBuildBroadphaseJobs(ref PhysicsWorld, Single, float3, NativeArray<Int32>, JobHandle, Boolean)
Declaration
public JobHandle ScheduleBuildBroadphaseJobs(ref PhysicsWorld world, float timeStep, float3 gravity, NativeArray<int> buildStaticTree, JobHandle inputDeps, bool multiThreaded = true)
Parameters
Returns
ScheduleFindOverlapsJobs(out NativeStream, out NativeStream, JobHandle, Boolean)
Declaration
public SimulationJobHandles ScheduleFindOverlapsJobs(out NativeStream dynamicVsDynamicPairsStream, out NativeStream staticVsDynamicPairsStream, JobHandle inputDeps, bool multiThreaded = true)
Parameters
Returns
ScheduleUpdateDynamicTree(ref PhysicsWorld, Single, float3, JobHandle, Boolean)
Declaration
public JobHandle ScheduleUpdateDynamicTree(ref PhysicsWorld world, float timeStep, float3 gravity, JobHandle inputDeps, bool multiThreaded = true)
Parameters
Returns
SphereCast(float3, Single, float3, Single, out ColliderCastHit, CollisionFilter, QueryInteraction)
Declaration
public bool SphereCast(float3 origin, float radius, float3 direction, float maxDistance, out ColliderCastHit hitInfo, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
SphereCast(float3, Single, float3, Single, CollisionFilter, QueryInteraction)
Declaration
public bool SphereCast(float3 origin, float radius, float3 direction, float maxDistance, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
SphereCastAll(float3, Single, float3, Single, ref NativeList<ColliderCastHit>, CollisionFilter, QueryInteraction)
Declaration
public bool SphereCastAll(float3 origin, float radius, float3 direction, float maxDistance, ref NativeList<ColliderCastHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Returns
Implements
SphereCastCustom<T>(float3, Single, float3, Single, ref T, CollisionFilter, QueryInteraction)
Declaration
public bool SphereCastCustom<T>(float3 origin, float radius, float3 direction, float maxDistance, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
where T : struct, ICollector<ColliderCastHit>
Parameters
Returns
Type Parameters
Implements
UpdateBodyIndexMap()
Declaration
public void UpdateBodyIndexMap()
UpdateDynamicTree(ref PhysicsWorld, Single, float3)
Declaration
public void UpdateDynamicTree(ref PhysicsWorld world, float timeStep, float3 gravity)
Parameters