diff --git a/package/src/bullet/hooks/useBoxShape.ts b/package/src/bullet/hooks/useBoxShape.ts index 65dcefc4..513693a2 100644 --- a/package/src/bullet/hooks/useBoxShape.ts +++ b/package/src/bullet/hooks/useBoxShape.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react' -import { Box } from '../types/Shapes' +import { BoxShape } from '../types/Shapes' import { BulletAPI } from '../bulletApi' -export function useBoxShape(halfX: number, halfY: number, halfZ: number): Box { +export function useBoxShape(halfX: number, halfY: number, halfZ: number): BoxShape { return useMemo(() => BulletAPI.createBoxShape(halfX, halfY, halfZ), [halfX, halfY, halfZ]) } diff --git a/package/src/bullet/hooks/useCylinderShape.ts b/package/src/bullet/hooks/useCylinderShape.ts index 9a0f8625..25cfffc2 100644 --- a/package/src/bullet/hooks/useCylinderShape.ts +++ b/package/src/bullet/hooks/useCylinderShape.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import { Cylinder } from '../types/Shapes' +import { CylinderShape } from '../types/Shapes' import { BulletAPI } from '../bulletApi' import { Float3 } from '../../types' @@ -8,7 +8,7 @@ type CylinderShapeProps = { localScaling?: Float3 } -export function useCylinderShape(props: CylinderShapeProps | undefined): Cylinder | undefined { +export function useCylinderShape(props: CylinderShapeProps | undefined): CylinderShape | undefined { const { half, localScaling } = props ?? {} const scaleX = localScaling?.[0] const scaleY = localScaling?.[1] diff --git a/package/src/bullet/hooks/useSphereShape.ts b/package/src/bullet/hooks/useSphereShape.ts index e71d9a3e..2d0b72cf 100644 --- a/package/src/bullet/hooks/useSphereShape.ts +++ b/package/src/bullet/hooks/useSphereShape.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react' -import { Sphere } from '../types/Shapes' +import { SphereShape } from '../types/Shapes' import { BulletAPI } from '../bulletApi' -export function useSphereShape(radius: number): Sphere { +export function useSphereShape(radius: number): SphereShape { return useMemo(() => BulletAPI.createSphereShape(radius), [radius]) } diff --git a/package/src/bullet/hooks/useStaticPlaneShape.ts b/package/src/bullet/hooks/useStaticPlaneShape.ts index 4bec0b2f..5c72f0bb 100644 --- a/package/src/bullet/hooks/useStaticPlaneShape.ts +++ b/package/src/bullet/hooks/useStaticPlaneShape.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react' -import { StaticPlane } from '../types/Shapes' +import { StaticPlaneShape } from '../types/Shapes' import { BulletAPI } from '../bulletApi' -export function useStaticPlaneShape(normalX: number, normalY: number, normalZ: number, constant: number): StaticPlane { +export function useStaticPlaneShape(normalX: number, normalY: number, normalZ: number, constant: number): StaticPlaneShape { return useMemo(() => BulletAPI.createStaticPlaneShape(normalX, normalY, normalZ, constant), [normalX, normalY, normalZ, constant]) } diff --git a/package/src/bullet/types/Shapes.ts b/package/src/bullet/types/Shapes.ts index 4b6c2f29..855ae789 100644 --- a/package/src/bullet/types/Shapes.ts +++ b/package/src/bullet/types/Shapes.ts @@ -5,10 +5,10 @@ export interface BaseShape { margin: number } -export interface Box extends BaseShape {} +export interface BoxShape extends BaseShape {} -export interface Cylinder extends BaseShape {} +export interface CylinderShape extends BaseShape {} -export interface StaticPlane extends BaseShape {} +export interface StaticPlaneShape extends BaseShape {} -export interface Sphere extends BaseShape {} +export interface SphereShape extends BaseShape {} diff --git a/package/src/bullet/types/api.ts b/package/src/bullet/types/api.ts index 7bfee61a..61adea9c 100644 --- a/package/src/bullet/types/api.ts +++ b/package/src/bullet/types/api.ts @@ -1,11 +1,11 @@ import { Mat4 } from '../../types/TransformManager' import { DiscreteDynamicWorld } from './DiscreteDynamicWorld' import { CollisionCallback, RigidBody } from './RigidBody' -import { BaseShape, Box, Cylinder, Sphere, StaticPlane } from './Shapes' +import { BaseShape, BoxShape, CylinderShape, SphereShape, StaticPlaneShape } from './Shapes' export interface BulletAPI { createDiscreteDynamicWorld(gravityX: number, gravityY: number, gravityZ: number): DiscreteDynamicWorld - createBoxShape(halfX: number, halfY: number, halfZ: number): Box + createBoxShape(halfX: number, halfY: number, halfZ: number): BoxShape /** * Implements a cylinder shape primitive, centered around the origin. Its central axis aligned with the Y axis. * cylinderShapeX is aligned with the X axis and cylinderShapeZ around the Z axis. @@ -21,11 +21,11 @@ export interface BulletAPI { * @param halfY * @param halfZ */ - createCylinderShape(halfX: number, halfY: number, halfZ: number): Cylinder - createCylinderShapeX(halfX: number, halfY: number, halfZ: number): Cylinder - createCylinderShapeZ(halfX: number, halfY: number, halfZ: number): Cylinder - createStaticPlaneShape(normalX: number, normalY: number, normalZ: number, constant: number): StaticPlane - createSphereShape(radius: number): Sphere + createCylinderShape(halfX: number, halfY: number, halfZ: number): CylinderShape + createCylinderShapeX(halfX: number, halfY: number, halfZ: number): CylinderShape + createCylinderShapeZ(halfX: number, halfY: number, halfZ: number): CylinderShape + createStaticPlaneShape(normalX: number, normalY: number, normalZ: number, constant: number): StaticPlaneShape + createSphereShape(radius: number): SphereShape createRigidBody( mass: number, x: number,