Skip to content

Spacial Bounce Option #3

@JRileyH

Description

@JRileyH

As a variable option parameter to Spacial class there should be a boolean “bounce” (default to false probably) that automatically adds on-collision behavior to dynamic Spacials.

The behavior should be to make appropriate changes to velocity to give the appearance of bouncing off another spacial after colliding.

This will require some subclassing and smart planning on where the behavior logic should be stored (most likely either physics/collisions.js function library or on the Spacial subclass). We also may want to make a Spacial bouncable on one physics world layer but only fire collision events on another layer so bounce options may need to be more complex than a boolean (string, boolean key value pair maybe)

This should also be extendable to utilize physical material properties stored on the spacial that dictate bounce behavior such as how much velocity is lost on bounce if we ever decide to add that. Perfect elastic collision is reasonable to assume for now though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions