ParallelGraphics Forums
SDK
You are here: [Forums]::[General]::[SDK]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
Try RobinZone!
email:  password:
   General - SDK

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.

 


Cortona and C#. Detect Collisions / marvega@able.es / 19.10.07 02:44

Messages in thread: 1


© 1998-2007 ParallelGraphics. All rights reserved. Terms of use.