Last active
February 22, 2021 01:27
-
-
Save PaperPrototype/9ed43e21127fbad4a6cae73d41e679dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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