Skip to content

Instantly share code, notes, and snippets.

@PaperPrototype
Last active February 22, 2021 01:27
Show Gist options
  • Save PaperPrototype/9ed43e21127fbad4a6cae73d41e679dc to your computer and use it in GitHub Desktop.
Save PaperPrototype/9ed43e21127fbad4a6cae73d41e679dc to your computer and use it in GitHub Desktop.
public class Collider : Spatial {
private Enum ColliderType { Box, Sphere, Capsule };
public virtual float GetArea(ColliderType colliderType) {
switch(colliderType) {
case Box:
// return area of box
break;
case Sphere:
// return area of sphere
break;
case Capsule:
// return area of capsule
break;
}
}
}
public class RigidBody : Collider {
public Vector3 velocity;
public float mass;
public float drag;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment