You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I experienced few problems when tried to use cannon by example and think it (example) should be extended:
Cannon and Hilo worlds works in different axes: Cannon uses Z as vertical, Hilo Y. It isn't issue itself since you can just set gravity in any direction, but for some bodies like planesit is problem. All ground bodies has to be rotated:
world.gravity.set(0,GRAVITY,0);//Hilo's gravity directionconstgroundBody=newcannon.Body({mass: 0,// mass == 0 makes the body staticquaternion: newcannon.Quaternion(0,0,0).setFromEuler(-Math.PI/2,0,0)//hilo's ground rotation});
Also i think it would be better to let cannon work in Z direction as it was, but then we need to swap axes like hilomesh.setPosition(this.body.position.x, this.body.position.z, this.body.position.y); and rotation too.
2. Linegeometry = new Hilo3d.BoxGeometry( 2, 2, 2 ); incorrect because BoxGeometry works with object argument, const geometry = new Hilo3d.BoxGeometry({ width: 2, height: 2, depth: 2 });
3. It doesn't clear from example that Hilo's bodies (Boxes) has to be twice bigger than cannon's
constgeometry=newHilo3d.BoxGeometry({width: 2,height: 2,depth: 2});constshape=newcannon.Box(newcannon.Vec3(1,1,1));//does it because cannon sets distance *from center*?
I don't sure is it problem exist only for boxes or whole cannon-hilo bind.
Thanks for your time!
The text was updated successfully, but these errors were encountered:
@06wj thanks for response and your work. Nice example.
Yep, and i think we already use two coordinate systems. Again, default rotation just wrong in cannon if we use it with hilo. It doesn't critical, but at least it deserves some comment note in example
Yes, but still, "it doesn't clear" - i suggest add your comment about it in code
Please, check out this article - The Importance of “Why” Docs. One line of comment can save hours of work for someone.
Hi.
I experienced few problems when tried to use cannon by example and think it (example) should be extended:
Also i think it would be better to let cannon work in Z direction as it was, but then we need to swap axes like
hilomesh.setPosition(this.body.position.x, this.body.position.z, this.body.position.y);
and rotation too.2. Line
geometry = new Hilo3d.BoxGeometry( 2, 2, 2 );
incorrect because BoxGeometry works with object argument,const geometry = new Hilo3d.BoxGeometry({ width: 2, height: 2, depth: 2 });
3. It doesn't clear from example that Hilo's bodies (Boxes) has to be twice bigger than cannon's
I don't sure is it problem exist only for boxes or whole cannon-hilo bind.
Thanks for your time!
The text was updated successfully, but these errors were encountered: