@@ -12,7 +12,10 @@ import {
1212 PhysicsPropertiesComponent ,
1313 PhysicsPropertiesComponentData ,
1414} from '../component/physics/PhysicsPropertiesComponent.js'
15- import { ColliderPropertiesComponentData } from '../component/physics/ColliderPropertiesComponent.js'
15+ import {
16+ ColliderPropertiesComponent ,
17+ ColliderPropertiesComponentData ,
18+ } from '../component/physics/ColliderPropertiesComponent.js'
1619import { ConvexHullColliderComponent } from '../component/physics/ConvexHullColliderComponent.js'
1720
1821export interface MeshParams {
@@ -51,7 +54,7 @@ export class Mesh {
5154 entity : Entity
5255
5356 constructor ( params : MeshParams ) {
54- const { position, meshUrl, physicsProperties } = params
57+ const { position, meshUrl, physicsProperties, colliderProperties } = params
5558
5659 this . entity = EntityManager . createEntity ( SerializedEntityType . CUBE )
5760
@@ -72,6 +75,9 @@ export class Mesh {
7275 )
7376 this . entity . addComponent ( serverMeshComponent )
7477
78+ this . entity . addComponent (
79+ new ColliderPropertiesComponent ( this . entity . id , colliderProperties ?? { } )
80+ )
7581 this . entity . addComponent (
7682 new ConvexHullColliderComponent (
7783 this . entity . id ,
0 commit comments