1- import { AABB , PhysicalObjectCallbackAggregate , PhysicsObject , Physx } from "../../../src"
1+ import { AABB , PhysicalObjectCallbackAggregate , PhysicsObject , Physx , Vec2 } from "../../../src"
22
33describe ( 'physx/Physx' , ( ) => {
44 let physx = new Physx ( ) ;
@@ -11,7 +11,8 @@ describe('physx/Physx', () => {
1111 it ( 'Should add the physicx object to the physics objects list' , ( ) => {
1212 const physicsObject : PhysicalObjectCallbackAggregate = {
1313 object : {
14- aabb : [ 10 , 10 , 25 , 25 ]
14+ aabb : [ 10 , 10 , 25 , 25 ] ,
15+ velocity : new Vec2 ( )
1516 } ,
1617 onCollisionCallback : ( postSimulation ) => { } ,
1718 } ;
@@ -25,14 +26,16 @@ describe('physx/Physx', () => {
2526 it ( 'Should trigger the Physics object callback if a collision is detected' , ( ) => {
2627 const physicsObject : PhysicalObjectCallbackAggregate = {
2728 object : {
28- aabb : [ 10 , 10 , 25 , 25 ]
29+ aabb : [ 10 , 10 , 25 , 25 ] ,
30+ velocity : new Vec2 ( )
2931 } ,
3032 onCollisionCallback : jest . fn ( ( ) => { } ) ,
3133 } ;
3234
3335 const physicsObject2 : PhysicalObjectCallbackAggregate = {
3436 object : {
35- aabb : [ 15 , 15 , 25 , 25 ]
37+ aabb : [ 15 , 15 , 25 , 25 ] ,
38+ velocity : new Vec2 ( )
3639 } ,
3740 onCollisionCallback : jest . fn ( ( ) => { } ) ,
3841 } ;
@@ -49,14 +52,16 @@ describe('physx/Physx', () => {
4952 it ( 'Should trigger the Physics object callback if a reverse collision is detected' , ( ) => {
5053 const physicsObject : PhysicalObjectCallbackAggregate = {
5154 object : {
52- aabb : [ 19 , 70 , 20 , 2 , ]
55+ aabb : [ 19 , 70 , 20 , 2 ] ,
56+ velocity : new Vec2 ( )
5357 } ,
5458 onCollisionCallback : jest . fn ( ( ) => { } ) ,
5559 } ;
5660
5761 const physicsObject2 : PhysicalObjectCallbackAggregate = {
5862 object : {
59- aabb : [ 0 , 0 , 20 , 150 ]
63+ aabb : [ 0 , 0 , 20 , 150 ] ,
64+ velocity : new Vec2 ( )
6065 } ,
6166 onCollisionCallback : jest . fn ( ( ) => { } ) ,
6267 } ;
@@ -73,14 +78,16 @@ describe('physx/Physx', () => {
7378 it ( 'Should not trigger a collision for object that are not colliding' , ( ) => {
7479 const physicsObject : PhysicalObjectCallbackAggregate = {
7580 object : {
76- aabb : [ 10 , 10 , 25 , 25 ]
81+ aabb : [ 10 , 10 , 25 , 25 ] ,
82+ velocity : new Vec2 ( )
7783 } ,
7884 onCollisionCallback : jest . fn ( ( ) => { } ) ,
7985 } ;
8086
8187 const physicsObject2 : PhysicalObjectCallbackAggregate = {
8288 object : {
83- aabb : [ 45 , 45 , 25 , 25 ]
89+ aabb : [ 45 , 45 , 25 , 25 ] ,
90+ velocity : new Vec2 ( )
8491 } ,
8592 onCollisionCallback : jest . fn ( ( ) => { } ) ,
8693 } ;
@@ -111,14 +118,16 @@ describe('physx/Physx', () => {
111118 const physicsObject : PhysicalObjectCallbackAggregate = {
112119 object : {
113120 aabb : test . containerAabb ,
121+ velocity : new Vec2 ( ) ,
114122 isContainer : true
115123 } ,
116124 onCollisionCallback : jest . fn ( ( ) => { } ) ,
117125 } ;
118126
119127 const physicsObject2 : PhysicalObjectCallbackAggregate = {
120128 object : {
121- aabb : test . otherAabb
129+ aabb : test . otherAabb ,
130+ velocity : new Vec2 ( )
122131 } ,
123132 onCollisionCallback : jest . fn ( ( ) => { } ) ,
124133 } ;
@@ -136,14 +145,16 @@ describe('physx/Physx', () => {
136145 const physicsObject : PhysicalObjectCallbackAggregate = {
137146 object : {
138147 aabb : [ 10 , 10 , 25 , 25 ] ,
139- isContainer : true
148+ isContainer : true ,
149+ velocity : new Vec2 ( )
140150 } ,
141151 onCollisionCallback : jest . fn ( ( ) => { } ) ,
142152 } ;
143153
144154 const physicsObject2 : PhysicalObjectCallbackAggregate = {
145155 object : {
146- aabb : [ 15 , 15 , 5 , 5 ]
156+ aabb : [ 15 , 15 , 5 , 5 ] ,
157+ velocity : new Vec2 ( )
147158 } ,
148159 onCollisionCallback : jest . fn ( ( ) => { } ) ,
149160 } ;
0 commit comments