≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Mesh-Mesh collisions?
Posted by:
(you are not logged in)
Enter the missing letter in: "Internati?nal"
(you are not logged in)
Text:
[quote][b]Mike[/b] wrote: I don't need perfect collisions, nor any physics simulation - if the objects were prevented from clipping each other's bounding box, it would be sufficient. The pre-placed cubes were showing the desired behavior, and the nodes added at run time (with same mesh) did not, what I was trying to understand was what caused the difference. Found it now: the collision world was set for the new nodes, but it was not reset when nodes were added, deleted or had their meshes changed. This mostly solves the problem (needs to be called after each of the above events): [code]CL3D.CopperLicht.prototype.resetCollisionWorld(){ this.getScene().CollisionWorld = this.getScene().createCollisionGeometry(true); this.setCollisionWorldForAllSceneNodes(this.getScene().getRootSceneNode(), this.getScene().CollisionWorld); };[/code] To fix the glitch with nodes retaining their old collision after setting new mesh, setMesh() has to be changed a bit: [code]CL3D.MeshSceneNode.prototype.setMesh = function (a) { this.OwnedMesh = a; if (a && a.GetPolyCount() > 100) { this.Selector = new CL3D.OctTreeTriangleSelector(c.OwnedMesh, c) } else { this.Selector = new CL3D.MeshTriangleSelector(a, this) } };[/code][/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact