≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Not Move To x ;)
Posted by:
(you are not logged in)
Enter the missing letter in: "Internat?onal"
(you are not logged in)
Text:
[quote][b][/b] wrote: [code] var cube = ccbGetSceneNodeFromName("Paci"); var pos3d = ccbGetSceneNodeProperty(cube, "Position"); //var colTest = ccbGetCollisionPointOfWorldWithLine(pos3d.x, pos3d.y, pos3d.z, (pos3d.x-5), pos3d.y, pos3d.z); var colTest = ccbDoesLineCollideWithBoundingBoxOfSceneNode(cube, pos3d.x, pos3d.y, pos3d.z, 0, 0, 0); //return always true ??? print("x: "+pos3d.x +" y: " + pos3d.y + " z: " + pos3d.z); print("Move_Down: "+Move_Down); print("Collision: "+colTest); if (colTest && Move_Down == 1) { print("Not Move!!!"); } else { print("Here!!!"); Move_Up = 0; Move_Down = 1; Move_Left = 0; Move_Right = 0; } [/code] I'm too stupid for this feature: "CcbDoesLineCollideWithBoundingBoxOfSceneNode (...) " How can I query the environment? *sad* var colTest = ccbDoesLineCollideWithBoundingBoxOfSceneNode(cube, pos3d.x, pos3d.y, pos3d.z, (pos3d.x+5), pos3d.y, pos3d.z); //return true ??? (In this position is actually nothing.) I'm trying to debug it, but the function always returns TRUE. I think I'm doing something fundamental wrong here. It should actually behave as in this example: (But it doesn't!) [code] var mouseX = ccbGetMousePosX(); var mouseY = ccbGetMousePosY(); // test collision var cube = ccbGetSceneNodeFromName("cubeMesh"); var endPoint3d = ccbGet3DPosFrom2DPos(mouseX, mouseY); var startPos3D = ccbGetSceneNodeProperty(ccbGetActiveCamera(), "Position"); if (ccbDoesLineCollideWithBoundingBoxOfSceneNode(cube, startPos3D.x, startPos3D.y, startPos3D.z, endPoint3d.x, endPoint3d.y, endPoint3d.z)) { ccbDrawColoredRectangle(0x77ff0000, mouseX-10, mouseY-10, mouseX+10, mouseY+10); } else ccbDrawColoredRectangle(0x770000ff, mouseX-10, mouseY-10, mouseX+10, mouseY+10); } [/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