Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Ray hit object

areibma
Registered User
Quote
2016-10-23 20:32:10

Hi,
Using the raycast, is there anyway to get the ray hit object by script?

And, how do I join the last path node?

Thank you


niko
Moderator
Quote
2016-10-24 05:59:08

Yes, you can use ccbDoesLineCollideWithBoundingBoxOfSceneNode() and ccbGetCollisionPointOfWorldWithLine(), those are exactly for this.

But I'm not sure what you meant by joining the last path node?


areibma
Registered User
Quote
2016-10-24 06:34:58

Seems like only ccbDoesLineCollideWithBoundingBoxOfSceneNode() returns the collision scene node. But the problem with this function is it will check the bounding box for collision, not the mesh node. I mean, if I cast a ray towards an enemy like fps shooting, it will hit the enemy even if ray is outside the actual shape of the node. See the attached image. The red dots are rayhit position.
🔎︎


Sorry for the confusion, I mean when we add the path node, the last and first node is not attached. I could not find out how to attach that nodes, so that Ai can walk in a loop.


just_in_case
Moderator
Quote
2016-10-24 17:59:20

In attributes menu of path... There is an item specific option

"is closed circle" tick that option and then ur path's last node will be joint to first node....


areibma
Registered User
Quote
2016-10-24 19:08:12

Oops, didn't thought about checking the attribute tab. Thank you.


niko
Moderator
Quote
2016-10-25 14:01:05

Currently only bounding box tests are supported there. For static world geometry, you can check against the world instead with that other function.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (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