/** * Get the rotation matrix of a placeable geom. * * If the geom is attached to a body, the body's rotation will be returned. * * Calling this function on a non-placeable geom results in a runtime error in * the debug build of ODE. * <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. * * @param geom the geom to query. * @return A pointer to the geom's rotation matrix. * @see ApiCppBody#dBodyGetRotation(DBody) */ //ODE_API public static final DMatrix3C dGeomGetRotation (DGeom geom) { return geom.getRotation(); }
/** * Get the rotation matrix of a placeable geom. * * If the geom is attached to a body, the body's rotation will be returned. * * Calling this function on a non-placeable geom results in a runtime error in * the debug build of ODE. * <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. * * @param geom the geom to query. * @return A pointer to the geom's rotation matrix. * @see ApiCppBody#dBodyGetRotation(DBody) */ //ODE_API public static final DMatrix3C dGeomGetRotation (DGeom geom) { return geom.getRotation(); }
/** * Get the rotation matrix of a placeable geom. * * If the geom is attached to a body, the body's rotation 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. * @param R a copy of the geom rotation * @see #dGeomGetRotation(DGeom) */ //ODE_API public static void dGeomCopyRotation(DGeom geom, DMatrix3 R) { R.set(geom.getRotation()); }
/** * Get the rotation matrix of a placeable geom. * * If the geom is attached to a body, the body's rotation 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. * @param R a copy of the geom rotation * @see #dGeomGetRotation(DGeom) */ //ODE_API public static void dGeomCopyRotation(DGeom geom, DMatrix3 R) { R.set(geom.getRotation()); }
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); } }
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); } }
final DMatrix3C Rot = world_mesh.getRotation();
if (R==null) R = g.getRotation();
private void drawGeom(DGeom g) DMatrix3C rot = g.getRotation();
if ( R == null ) R = g.getRotation();
pos = g.getPosition (); if (R==null) R = g.getRotation ();
if (R==null) R = g.getRotation ();
if (R == null) R = g.getRotation ();