protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper draw_helper) { draw_helper.pushModelTransform(); { m_xaxis.Draw(lod, draw_helper); } draw_helper.popModelTransform(); UWB_XFormInfo yrot = new UWB_XFormInfo(); yrot.UpdateRotationZByDegree(-90.0f); draw_helper.pushModelTransform(); { yrot.setupModelStack(draw_helper); m_yaxis.Draw(lod, draw_helper); } draw_helper.popModelTransform(); UWB_XFormInfo zrot = new UWB_XFormInfo(); zrot.UpdateRotationYByDegree(90.0f); draw_helper.pushModelTransform(); { zrot.setupModelStack(draw_helper); m_zaxis.Draw(lod, draw_helper); } draw_helper.popModelTransform(); }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper draw_helper) { draw_helper.pushModelTransform(); { m_xaxis.Draw(lod, draw_helper); } draw_helper.popModelTransform(); UWB_XFormInfo yrot = new UWB_XFormInfo(); yrot.UpdateRotationZByDegree(-90.0f); draw_helper.pushModelTransform(); { yrot.setupModelStack(draw_helper); m_yaxis.Draw(lod, draw_helper); } draw_helper.popModelTransform(); UWB_XFormInfo zrot = new UWB_XFormInfo(); zrot.UpdateRotationYByDegree(90.0f); draw_helper.pushModelTransform(); { zrot.setupModelStack(draw_helper); m_zaxis.Draw(lod, draw_helper); } draw_helper.popModelTransform(); }
/// /// Draw all of the geometry that is part of this model. internal void DrawModel(bool drawCamera) { eLevelofDetail lod = m_DrawHelper.getLod(); m_DrawHelper.initializeModelTransform(); m_DrawHelper.pushModelTransform(); m_RootNode.Draw(lod, m_DrawHelper); if (!drawCamera) // this is the preview window { m_SceneDatabase.Draw(lod, m_DrawHelper); } else if (mDrawDB) { m_SceneDatabase.Draw(lod, m_DrawHelper); } if (drawCamera) { mCamera.Draw(lod, m_DrawHelper); if (null != mDebugInfo) { mDebugInfo.Draw(lod, m_DrawHelper); } } m_DrawHelper.popModelTransform(); }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { eLevelofDetail oldLod = drawHelper.getLod(); drawHelper.setLod(lod); drawHelper.drawCircle(mCenter, mRadius); drawHelper.setLod(oldLod); }
public UWB_DrawHelper() { mLod = eLevelofDetail.lodHigh; mShadeMode = eShadeMode.smGouraud; mFillMode = eFillMode.fmSolid; m_TexFileName = null; resetAttributes(); m_MatrixStack = new UWB_MatrixStack(); }
public UWB_DrawHelper() { mLod = eLevelofDetail.lodHigh; mShadeMode = eShadeMode.smGouraud; mFillMode = eFillMode.fmSolid; m_TexFileName = null; resetAttributes(); m_MatrixStack = new UWB_MatrixStack(); }
public void Draw(eLevelofDetail lod, UWB_DrawHelper drawHelper) { if (!mVisible) return; SetupDrawAttributes(drawHelper); DrawPrimitive(lod, drawHelper); if (isDrawingBoundingVolume()) drawBoundingVolume(lod, drawHelper, Color.Red); }
public void drawBoundingVolume(eLevelofDetail lod, UWB_DrawHelper drawHelper, Color color) { UWB_BoundingVolume boundingVolume = getBoundingVolume(lod); if (boundingVolume != null && drawHelper != null) { drawHelper.resetAttributes(); drawHelper.setColor1(color); drawHelper.setShadeMode(eShadeMode.smFlat); drawHelper.setFillMode(eFillMode.fmWireframe); boundingVolume.Draw(ref drawHelper); } }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { int count = mList.count(); for (int i = 0; i < count; i++) { UWB_Primitive primitive = mList.getItem(i); if (primitive != null) { primitive.Draw(lod, drawHelper); } } }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper draw_helper) { UWB_XNAGraphicsDevice graphics = UWB_XNAGraphicsDevice.m_TheAPI; UWB_XNAPrimitiveMesh pCylinderMesh = new UWB_XNAPrimitiveMesh("cylinder"); UWB_XNAPrimitiveMesh pConeMesh = new UWB_XNAPrimitiveMesh("cone"); if (pCylinderMesh != null && pConeMesh != null) { pCylinderMesh.Material = Material; pConeMesh.Material = Material; draw_helper.pushModelTransform(); { // Need to add support for finding the bounding box of a mesh // the Z value is hard coded until then //UWB_BoundingBox box = (pCylinderMesh.getBoundingVolume(draw_helper.getLod()) as UWB_BoundingBox); UWB_XFormInfo cylinder_xform = new UWB_XFormInfo(); cylinder_xform.SetScale(new Vector3(0.025f, 0.025f, 0.2666666666f)); cylinder_xform.UpdateRotationYByDegree(-90.0f); cylinder_xform.SetTranslation(new Vector3(0.4f, 0.0f, 0.0f)); cylinder_xform.setupModelStack(draw_helper); try { pCylinderMesh.setMesh(graphics.mResources.Load<Model>("cylinder")); pCylinderMesh.DrawMesh(true, mFlatColor, draw_helper); } catch (Exception e) { UWBGL_XNA_Lib.UWB_Utility.echoToStatusArea((e.Message)); } //pCylinderMesh.DrawMesh(false, mFlatColor,draw_helper); } draw_helper.popModelTransform(); draw_helper.pushModelTransform(); { //const UWB_BoundingBox box = pConeMesh.getBoundingBox(); UWB_XFormInfo cone_xform = new UWB_XFormInfo(); cone_xform.SetScale(new Vector3(0.08f,0.08f, 0.1f)); cone_xform.UpdateRotationYByDegree(-90.0f); cone_xform.SetTranslation(new Vector3(0.85f,0.0f,0.0f)); cone_xform.setupModelStack(draw_helper); try { pConeMesh.setMesh(graphics.mResources.Load<Model>("cone")); pConeMesh.DrawMesh(true, mFlatColor, draw_helper); } catch (Exception e) { UWBGL_XNA_Lib.UWB_Utility.echoToStatusArea((e.Message)); } //pConeMesh.DrawMesh(false, mFlatColor, draw_helper); } draw_helper.popModelTransform(); } }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { UWB_XNAGraphicsDevice graphics = UWB_XNAGraphicsDevice.m_TheAPI; try { mesh = graphics.mResources.Load <Model>(filename); DrawMesh(true, this.mFlatColor, drawHelper); } catch (Exception e) { UWBGL_XNA_Lib.UWB_Utility.echoToStatusArea((e.Message)); } }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper draw_helper) { UWB_XNAGraphicsDevice graphics = UWB_XNAGraphicsDevice.m_TheAPI; UWB_XNAPrimitiveMesh pCylinderMesh = new UWB_XNAPrimitiveMesh("cylinder"); UWB_XNAPrimitiveMesh pConeMesh = new UWB_XNAPrimitiveMesh("cone"); if (pCylinderMesh != null && pConeMesh != null) { pCylinderMesh.Material = Material; pConeMesh.Material = Material; draw_helper.pushModelTransform(); { // Need to add support for finding the bounding box of a mesh // the Z value is hard coded until then //UWB_BoundingBox box = (pCylinderMesh.getBoundingVolume(draw_helper.getLod()) as UWB_BoundingBox); UWB_XFormInfo cylinder_xform = new UWB_XFormInfo(); cylinder_xform.SetScale(new Vector3(0.025f, 0.025f, 0.2666666666f)); cylinder_xform.UpdateRotationYByDegree(-90.0f); cylinder_xform.SetTranslation(new Vector3(0.4f, 0.0f, 0.0f)); cylinder_xform.setupModelStack(draw_helper); try { pCylinderMesh.setMesh(graphics.mResources.Load <Model>("cylinder")); pCylinderMesh.DrawMesh(true, mFlatColor, draw_helper); } catch (Exception e) { UWBGL_XNA_Lib.UWB_Utility.echoToStatusArea((e.Message)); } //pCylinderMesh.DrawMesh(false, mFlatColor,draw_helper); } draw_helper.popModelTransform(); draw_helper.pushModelTransform(); { //const UWB_BoundingBox box = pConeMesh.getBoundingBox(); UWB_XFormInfo cone_xform = new UWB_XFormInfo(); cone_xform.SetScale(new Vector3(0.08f, 0.08f, 0.1f)); cone_xform.UpdateRotationYByDegree(-90.0f); cone_xform.SetTranslation(new Vector3(0.85f, 0.0f, 0.0f)); cone_xform.setupModelStack(draw_helper); try { pConeMesh.setMesh(graphics.mResources.Load <Model>("cone")); pConeMesh.DrawMesh(true, mFlatColor, draw_helper); } catch (Exception e) { UWBGL_XNA_Lib.UWB_Utility.echoToStatusArea((e.Message)); } //pConeMesh.DrawMesh(false, mFlatColor, draw_helper); } draw_helper.popModelTransform(); } }
public override UWB_BoundingVolume getBoundingVolume(eLevelofDetail lod) { UWB_XNAGraphicsDevice graphics = UWB_XNAGraphicsDevice.m_TheAPI; try { mesh = graphics.mResources.Load <Model>(filename); return(m_bounds); } catch (Exception e) { UWBGL_XNA_Lib.UWB_Utility.echoToStatusArea((e.Message)); return(null); } }
public void drawChildBoundingVolumes(eLevelofDetail lod, UWB_DrawHelper drawHelper, Color color) { if (drawHelper == null) return; int count = this.count(); for (int i = 0; i < count; i++) { UWB_Primitive primitive = mList.getItem(i); if (primitive != null) { primitive.drawBoundingVolume(lod, drawHelper, color); } } }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { Vector3 origin = new Vector3(); Vector3 xaxis = new Vector3(m_size, 0, 0); Vector3 yaxis = new Vector3(0, m_size, 0); Vector3 zaxis = new Vector3(0, 0, m_size); eLevelofDetail oldLod = drawHelper.getLod(); drawHelper.setLod(lod); drawHelper.setColor1(Color.Red); drawHelper.drawLine(origin, xaxis); drawHelper.setColor1(Color.Green); drawHelper.drawLine(origin, yaxis); drawHelper.setColor1(Color.Blue); drawHelper.drawLine(origin, zaxis); drawHelper.setLod(oldLod); }
public void Draw(eLevelofDetail lod, UWB_DrawHelper drawHelper) { if (!mVisible) { return; } SetupDrawAttributes(drawHelper); DrawPrimitive(lod, drawHelper); if (isDrawingBoundingVolume()) { drawBoundingVolume(lod, drawHelper, Color.Red); } }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { Vector3 origin = new Vector3(); Vector3 xaxis = new Vector3(m_size, 0, 0); Vector3 yaxis = new Vector3(0, m_size, 0); Vector3 zaxis = new Vector3(0, 0, m_size); eLevelofDetail oldLod = drawHelper.getLod(); drawHelper.setLod(lod); drawHelper.setColor1(Color.Red); drawHelper.drawLine(origin, xaxis); drawHelper.setColor1(Color.Green); drawHelper.drawLine(origin, yaxis); drawHelper.setColor1(Color.Blue); drawHelper.drawLine(origin, zaxis); drawHelper.setLod(oldLod); }
public override UWB_BoundingVolume getBoundingVolume(eLevelofDetail lod) { int count = mList.count(); if (count == 0) return null; mBounds.makeInvalid(); // NOTE: This is pretty inefficient. We could speed this up by maintaining // some sort of "changed" flag and only updating the bounds when this flag changes for (int i = 0; i < count; i++) { UWB_Primitive child = mList.getItem(i); mBounds.add(child.getBoundingVolume(lod)); } return mBounds; }
public void drawChildBoundingVolumes(eLevelofDetail lod, UWB_DrawHelper drawHelper, Color color) { if (drawHelper == null) { return; } int count = this.count(); for (int i = 0; i < count; i++) { UWB_Primitive primitive = mList.getItem(i); if (primitive != null) { primitive.drawBoundingVolume(lod, drawHelper, color); } } }
public override UWB_BoundingVolume getBoundingVolume(eLevelofDetail lod) { int count = mList.count(); if (count == 0) { return(null); } mBounds.makeInvalid(); // NOTE: This is pretty inefficient. We could speed this up by maintaining // some sort of "changed" flag and only updating the bounds when this flag changes for (int i = 0; i < count; i++) { UWB_Primitive child = mList.getItem(i); mBounds.add(child.getBoundingVolume(lod)); } return(mBounds); }
public void Draw(eLevelofDetail lod, UWB_DrawHelper drawHelper) { drawHelper.pushModelTransform(); mXFormInfo.setupModelStack(drawHelper); if (mPrimitive != null) { mPrimitive.Draw(lod, drawHelper); } int count = mChildNodes.count(); for (int i = 0; i < count; i++) { mChildNodes.getItem(i).Draw(lod, drawHelper); } if (mPivotVisible) { mXFormInfo.drawPivot(drawHelper, .2f); } drawHelper.popModelTransform(); }
public void Draw(eLevelofDetail lod, UWB_DrawHelper drawHelper) { drawHelper.pushModelTransform(); mXFormInfo.setupModelStack(drawHelper); if (mPrimitive != null) { mPrimitive.Draw(lod, drawHelper); } int count = mChildNodes.count(); for (int i = 0; i < count; i++) { mChildNodes.getItem(i).Draw(lod, drawHelper); } if (mPivotVisible) { mXFormInfo.drawPivot(drawHelper, .2f); } drawHelper.popModelTransform(); }
public void setLod(eLevelofDetail lod) { mLod = lod; }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { UWB_XNAGraphicsDevice graphics = UWB_XNAGraphicsDevice.m_TheAPI; try { mesh = graphics.mResources.Load<Model>(filename); DrawMesh(true, this.mFlatColor, drawHelper); } catch (Exception e) { UWBGL_XNA_Lib.UWB_Utility.echoToStatusArea((e.Message)); } }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { drawHelper.drawPoint(mPoint); }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { int count = mList.count(); for (int i = 0; i < count; i++) { UWB_Primitive primitive = mList.getItem(i); if (primitive != null) { primitive.Draw(lod, drawHelper); } } }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { drawHelper.drawTriangle(mV1, mV2, mV3); }
public void setLod(eLevelofDetail lod) { mLod = lod; }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { drawHelper.drawRectangle(m_bounds.getMin(), m_bounds.getMax()); }
public void drawBoundingVolume(eLevelofDetail lod, UWB_DrawHelper drawHelper, Color color) { UWB_BoundingVolume boundingVolume = getBoundingVolume(lod); if (boundingVolume != null && drawHelper != null) { drawHelper.resetAttributes(); drawHelper.setColor1(color); drawHelper.setShadeMode(eShadeMode.smFlat); drawHelper.setFillMode(eFillMode.fmWireframe); boundingVolume.Draw(ref drawHelper); } }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { drawHelper.drawTriangle(mV1, mV2, mV3); }
protected virtual void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { drawHelper.drawLine(mStart, mEnd); }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { drawHelper.drawPoint(mPoint); }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { eLevelofDetail oldLod = drawHelper.getLod(); drawHelper.setLod(lod); drawHelper.drawCircle(mCenter, mRadius); drawHelper.setLod(oldLod); }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { drawHelper.drawRectangleXZ(m_bounds.getMin(), m_bounds.getMax()); }
public override UWB_BoundingVolume getBoundingVolume(eLevelofDetail lod) { return mBounds; }
public override UWB_BoundingVolume getBoundingVolume(eLevelofDetail lod) { UWB_XNAGraphicsDevice graphics = UWB_XNAGraphicsDevice.m_TheAPI; try { mesh = graphics.mResources.Load<Model>(filename); return m_bounds; } catch (Exception e) { UWBGL_XNA_Lib.UWB_Utility.echoToStatusArea((e.Message)); return null; } }
public override UWB_BoundingVolume getBoundingVolume(eLevelofDetail lod) { mBounds.setCorners(mStart, mEnd); return mBounds; }
public override UWB_BoundingVolume getBoundingVolume(eLevelofDetail lod) { mBounds.setCorners(mStart, mEnd); return(mBounds); }
public virtual UWB_BoundingVolume getBoundingVolume(eLevelofDetail lod) { return null; }
public override UWB_BoundingVolume getBoundingVolume(eLevelofDetail lod) { return(mBounds); }
protected virtual void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { }
protected override void DrawPrimitive(eLevelofDetail lod, UWB_DrawHelper drawHelper) { drawHelper.drawLine(mStart, mEnd); }
public virtual UWB_BoundingVolume getBoundingVolume(eLevelofDetail lod) { return(null); }