Skip to content

RFP: How should shape-specific APIs be exposed? #35

@codynova

Description

@codynova

Some functions are specific to a shape class - for example, Cannon's ConvexPolyhedron shape has a transformAllPoints function which can be used to adjust the alignment axes for the shape. This function is useful for orienting physics bodies and meshes into the same axes.

I'm requesting proposals on how use-cannon should expose these shape-specific APIs? We can continue to add all available APIs to the object returned from useBody, but some (many?) of those will not actually be valid depending on which hook you are using.

Maybe we could have a generic API object with methods which are valid for all physics bodies, and spread spread that into a second API object that's generated based on the type of the shape (and maybe a third based on the body type if necessary)?

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions