-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: delegate responsibilities to sub-utils
### Description - Add `createRigiBody` util - Add `CreateRigidBodyProps` type - `createRigidBodyDesc` need an object now - Add `CreateRigidBodyDescProps` type - `createColliderDesc ` need an object now - Add `CreateColliderDescProps ` type - Add `createCollider` util - Add `CreateColliderProps` type - Add `createColliderFromChildren` util - Add `CreateColliderFromChildrenProps` type - Map received children colliders and update their states
- Loading branch information
1 parent
9441602
commit 8412712
Showing
6 changed files
with
202 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,34 @@ | ||
import type { TresObject } from '@tresjs/core' | ||
import type { World } from '@dimforge/rapier3d-compat' | ||
|
||
import type { ColliderShape } from './collider.type' | ||
|
||
/** @description Tres Rapier supported `RigidBody` types. */ | ||
export type RigidBodyType = | ||
| 'dynamic' | ||
| 'kinematic' | ||
| 'kinematicVelocity' | ||
| 'fixed' | ||
|
||
export interface RigidBodyProps { | ||
/** @description Set the `RigidBody` type. */ | ||
type: RigidBodyType | ||
/** @description Set the `RigidBody` collider shape. */ | ||
collider: ColliderShape | ||
} | ||
|
||
export interface CreateRigidBodyDescProps { | ||
/** @description The parent object. (@link TresObject}. */ | ||
object: TresObject | ||
/** @description The `rigidBody` type. {@link RigidBodyType}. */ | ||
rigidBodyType: RigidBodyType | ||
} | ||
|
||
export interface CreateRigidBodyProps extends CreateRigidBodyDescProps { | ||
/** | ||
* @description The Rapier {@link World} context. | ||
* | ||
* @see https://rapier.rs/javascript3d/classes/World.html | ||
*/ | ||
world: World | ||
} |
This file contains 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
This file contains 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