Vixen
02b45cc4
csharp
public struct Collider

The collision volume an entity has, and what it is made of.

No guide page documents this yet — the page shows what the code says about itself.

As a scene component

Size
20 bytes — 512 rows in a 16 KB chunk, alone on the archetype

Remarks

The shape is a ShapeId into PhysicsWorld.Shapes rather than a reference, which is what keeps this a plain struct in a chunk column instead of a managed component behind a handle indirection — see ManagedComponentStore for why that matters, and ShapeId for why it is also the form a scene file and a network message want.

An entity with a Collider and no RigidBody gets a static body. That is the common case by a wide margin — a level is mostly collision geometry that never moves — and making it the one that needs no second component is what stops every piece of scenery from carrying a RigidBody { Motion = Static }.

Fields and properties (5)

  • public ShapeId Shape

    The volume.

  • public PhysicsLayer Layer

    Which layer it is on, and so what it collides with.

  • public float Friction

    Friction, roughly 0 (ice) to 1 (rubber).

  • public float Restitution

    Bounciness, 0 (clay) to 1 (perfectly elastic).

  • public bool IsSensor

    Whether it reports overlaps instead of resolving them.

Methods (2)

Used by (10)

  • ArenaThirdPersonShooter
  • CharacterAllocationTestsVixen.Physics.Tests
  • CharacterSceneTestsVixen.Physics.Tests
  • ComponentRegistrationVixen.Physics
  • MachineVixen.Net.Physics.Tests
  • PhysicsSceneVixen.Physics
  • PhysicsSceneComponentTestsVixen.Physics.Tests
  • PhysicsSceneTestsVixen.Physics.Tests
  • PhysicsSyncSystemVixen.Physics
  • Vixen_Physics_Ecs_ColliderSerializerVixen.Physics