Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
How to use ccbGetCollisionPointOfWorldWithLine(startX, startY, startZ, endX, endY, endZ)?

eminem100
Guest
Quote
2017-06-29 17:43:22

How to use the function ccbGetCollisionPointOfWorldWithLine(startX, startY, startZ, endX, endY, endZ) and to check if there is collision or not. The manual says it will return null. I don't understand this.


niko
Moderator
Quote
2017-06-30 08:23:57

It will return an object (not null) if it finds a collision. The object is the point where the collision is. If it returns no object (=null), then no collision was found.

You can use it like this:
var collisionPoint = ccbGetCollisionPointOfWorldWithLine(...);
if (collisionPoint != null)
{
// this code inside here only gets run if there was a collision
}



Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

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