ParallelGraphics Forums
SDK
You are here:
[Forums]
::
[General]
::
[SDK]
All forums
How to use forums
Favorites
Services
Registration
Registration
Forgot your password?
Help
Help
Support
Quick search
Subscribe to newsletters
email:
password:
 
General
-
SDK
[reply]
[back to forum]
[new message]
[all forums]
Subject:
Cortona and C#. Detect Collisions
Sender:
marvega@able.es
19.10.07 02:44
I'm new using Cortona aplication. I need to use Cortona in C#.
I want to detect collisions between objects and I have de following Code:
VRMLFaceCollider Collider;
VRMLEngine engine;
Boolean colision;
SFVec3f vec=null;
engine = (VRMLEngine)Cortona1.Engine;
vec = (SFVec3f)engine.CreateField("SFVec3f");
vec.x = Convert.ToSingle("0");
vec.y = Convert.ToSingle("0"); ;
vec.z = Convert.ToSingle("0"); ;
Collider = engine.CreateFaceCollider();
object nombre = "tubo";
VRMLNode nod = engine.Nodes.get_Item(ref nombre);
Collider.Object = nod;
object geom = "Utillaje_1";
VRMLNode ng = engine.Nodes.get_Item(ref geom);
Collider.Geometry = ng;
object ov = vec.get_value();
//object ov = vec.get_variant();
colision = Collider.DetectTranslation(ref ov);
object kk = Collider.ValidTranslation;
if (colision)
MessageBox.Show("Collision");
else
MessageBox.Show("Not Collision");
The function DetectTranslation needs an object translation, this object is an array of three dimensions. I think that I get this object with the funcion vec.get_value() vec.get_variant(), but the system shows the following error on the function DetectTranslation "Invalid VRML object"
Someone knows which is my problem? How can I solve that?
Thanks a lot.
[reply]
[back to forum]
[new message]
[all forums]
Cortona and C#. Detect Collisions
/
marvega@able.es
/ 19.10.07 02:44
Messages in thread:
1
[reply]
[back to forum]
[new message]
[all forums]
© 1998-2007
ParallelGraphics
. All rights reserved.
Terms of use
.