/** * Get the position vector of a placeable geom. * * If the geom is attached to a body, the body's position will be returned. * * Calling this function on a non-placeable geom results in a runtime error in * the debug build of ODE. * * @param geom the geom to query. * @return A pointer to the geom's position vector. * <p>REMARK: The returned value is a pointer to the geom's internal * data structure. It is valid until any changes are made * to the geom. * @see ApiCppBody#dBodyGetPosition(DBody) */ //ODE_API public static final DVector3C dGeomGetPosition (DGeom geom) { return geom.getPosition(); }
/** * Get the position vector of a placeable geom. * * If the geom is attached to a body, the body's position will be returned. * * Calling this function on a non-placeable geom results in a runtime error in * the debug build of ODE. * * @param geom the geom to query. * @return A pointer to the geom's position vector. * <p>REMARK: The returned value is a pointer to the geom's internal * data structure. It is valid until any changes are made * to the geom. * @see ApiCppBody#dBodyGetPosition(DBody) */ //ODE_API public static final DVector3C dGeomGetPosition (DGeom geom) { return geom.getPosition(); }
/** * Copy the position of a geom into a vector. * * @param geom the geom to query * @param pos a copy of the geom position * @see #dGeomGetPosition(DGeom) */ //ODE_API public static void dGeomCopyPosition (DGeom geom, DVector3 pos) { pos.set(geom.getPosition()); }
/** * Copy the position of a geom into a vector. * * @param geom the geom to query * @param pos a copy of the geom position * @see #dGeomGetPosition(DGeom) */ //ODE_API public static void dGeomCopyPosition (DGeom geom, DVector3 pos) { pos.set(geom.getPosition()); }
private void drawGeom(DGeom g) { //int gclass = dGeomGetClass(g); if (g instanceof DCapsule) { DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); DCapsule cap = (DCapsule) g; dsDrawCapsule (pos, rot, cap.getLength(), cap.getRadius()); } }
private void drawGeom(DGeom g) { //int gclass = dGeomGetClass(g); if (g instanceof DCapsule) { DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); DCapsule cap = (DCapsule) g; dsDrawCapsule (pos, rot, cap.getLength(), cap.getRadius()); } }
private void drawGeom(DGeom g) { DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); if (g instanceof DCylinder) { DCylinder cyl = (DCylinder) g; if (g == geom1) { dsSetColorAlpha(1, 0, 0, 1); } else { dsSetColorAlpha(0, 1, 0, 1); } dsSetTexture (DS_TEXTURE_NUMBER.DS_WOOD); dsDrawCylinder(pos, rot, cyl.getLength(), cyl.getRadius()); } else { System.exit(0); } }
private void drawGeom(DGeom g) { DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); if (g instanceof DBox) { if (applyForce) { dsSetColor(1., .5, 0.); } else { dsSetColor(1, 1, 0); } dsSetTexture (DS_TEXTURE_NUMBER.DS_WOOD); DVector3C lengths = ((DBox)g).getLengths(); dsDrawBox(pos, rot, lengths); } }
private void drawGeom (DGeom g) { DVector3C pos = g.getPosition(); DMatrix3C R = g.getRotation(); //int type = dGeomGetClass (g); if (g instanceof DBox) { DVector3C sides = ((DBox)g).getLengths (); dsDrawBox (pos,R,sides); } if (g instanceof DCylinder) { double r = ((DCylinder)g).getRadius(); double l = ((DCylinder)g).getLength(); dsDrawCylinder (pos, R, l, r); } }
/** General collide function */ // static int ccdCollide(dGeomID o1, dGeomID o2, int flags, // dContactGeom *contact, int skip, // void *obj1, ccd_support_fn supp1, ccd_center_fn cen1, // void *obj2, ccd_support_fn supp2, ccd_center_fn cen2); static void ccdGeomToObj(final DGeom g, ccd_obj_t o) { DVector3C ode_pos; DQuaternionC ode_rot; ode_pos = g.getPosition(); ode_rot = g.getQuaternion(); ccdVec3Set(o.pos, ode_pos); ccdQuatSet(o.rot, ode_rot.get1(), ode_rot.get2(), ode_rot.get3(), ode_rot.get0()); ccdQuatInvert2(o.rot_inv, o.rot); }
/** General collide function */ // static int ccdCollide(dGeomID o1, dGeomID o2, int flags, // dContactGeom *contact, int skip, // void *obj1, ccd_support_fn supp1, ccd_center_fn cen1, // void *obj2, ccd_support_fn supp2, ccd_center_fn cen2); static void ccdGeomToObj(final DGeom g, ccd_obj_t o) { DVector3C ode_pos; DQuaternionC ode_rot; ode_pos = g.getPosition(); ode_rot = g.getQuaternion(); ccdVec3Set(o.pos, ode_pos); ccdQuatSet(o.rot, ode_rot.get1(), ode_rot.get2(), ode_rot.get3(), ode_rot.get0()); ccdQuatInvert2(o.rot_inv, o.rot); }
private void drawGeom(DGeom g) { //int gclass = dGeomGetClass(g); DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); if (g instanceof DSphere) { dsSetColorAlpha(0, 0.75, 0.5, 1); dsSetTexture (DS_TEXTURE_NUMBER.DS_CHECKERED); dsDrawSphere(pos, rot, ((DSphere)g).getRadius()); } else if (g instanceof DBox) { dsSetColorAlpha(1, 1, 0, 1); dsSetTexture (DS_TEXTURE_NUMBER.DS_WOOD); DVector3C lengths = ((DBox)g).getLengths(); dsDrawBox(pos, rot, lengths); } }
private void drawGeom(DGeom g) { //int gclass = dGeomGetClass(g); DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); if (g instanceof DSphere) { dsSetColorAlpha(0, 0.75, 0.5, 1); dsSetTexture (DS_TEXTURE_NUMBER.DS_CHECKERED); dsDrawSphere(pos, rot, ((DSphere)g).getRadius()); } else if (g instanceof DBox) { dsSetColorAlpha(1, 1, 0, 1); dsSetTexture (DS_TEXTURE_NUMBER.DS_WOOD); DVector3C lengths = ((DBox)g).getLengths(); dsDrawBox(pos, rot, lengths); } }
private void simLoop (boolean pause) { int i; if (!pause) { // apply forces to all bodies for (i=0; i<N1; i++) { for (int j=0; j<N2; j++) { body[i][j].addForce (FORCE*(i+1),0,0); } } OdeHelper.spaceCollide (space,0,nearCallback); world.step (0.05); // remove all contact joints contactgroup.empty(); } dsSetColor (1,0,1); DVector3 sides = new DVector3(LENGTH,LENGTH,HEIGHT); for (i=0; i<N1; i++) { for (int j=0; j<N2; j++) { dsDrawBox (box[i][j].getPosition(), box[i][j].getRotation(), sides); } } }
private void drawGeom (DGeom g, DVector3C pos, DMatrix3C R) { if (g==null) return; if (pos==null) pos = g.getPosition (); if (R==null) R = g.getRotation (); if (g instanceof DBox) { DVector3C sides = ((DBox)g).getLengths(); dsDrawBox (pos,R,sides); } else if (g instanceof DSphere) { dsDrawSphere( pos,R, ((DSphere)g).getRadius() ); } else if (g instanceof DCapsule) { DCapsule c = (DCapsule) g; dsDrawCapsule( pos, R, c.getLength(), c.getRadius() ); } else if (g instanceof DCylinder) { DCylinder c = (DCylinder) g; dsDrawCylinder (pos, R, c.getLength(), c.getRadius()); } else if (g instanceof DConvex) { //dVector3 sides={0.50,0.50,0.50}; dsDrawConvex(pos,R,ConvexCubeGeom.planes, ConvexCubeGeom.planecount, ConvexCubeGeom.points, ConvexCubeGeom.pointcount, ConvexCubeGeom.polygons); } }
dsSetTexture (DS_TEXTURE_NUMBER.DS_NONE); final DVector3C Pos = world_mesh.getPosition();
if (pos==null) pos = g.getPosition(); if (R==null) R = g.getRotation();
return; if (pos==null) pos = g.getPosition (); if (R==null) R = g.getRotation ();
private void drawGeom (DGeom g, DVector3C pos, DMatrix3C R, boolean show_aabb) if (pos==null) pos = g.getPosition (); if (R==null) R = g.getRotation ();
private void drawGeom( DGeom g, DVector3C pos, DMatrix3C R, boolean show_aabb ) if ( pos == null ) pos = g.getPosition(); if ( R == null ) R = g.getRotation();