本文整理汇总了C#中Mogre类的典型用法代码示例。如果您正苦于以下问题:C# Mogre类的具体用法?C# Mogre怎么用?C# Mogre使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Mogre类属于命名空间,在下文中一共展示了Mogre类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Trigger
public Trigger(string _shapename, Mogre.Vector3 _shapesize)
{
switch (_shapename)
{
case "box":
m_collision = new MogreNewt.CollisionPrimitives.Box(
Core.Singleton.NewtonWorld,
_shapesize,
new Mogre.Quaternion(new Mogre.Radian(1.57f), new Mogre.Vector3(0, 0, 1)),
Core.Singleton.GetUniqueBodyId()
);
break;
case "ellipsoid":
m_collision = new MogreNewt.CollisionPrimitives.Ellipsoid(
Core.Singleton.NewtonWorld,
_shapesize,
new Mogre.Quaternion(new Mogre.Radian(1.57f), new Mogre.Vector3(0, 0, 1)),
Core.Singleton.GetUniqueBodyId()
);
break;
}
m_collision.IsTriggerVolume = true;
m_Body = new MogreNewt.Body(Core.Singleton.NewtonWorld, m_collision, true);
m_Body.UserData = this;
m_Body.Type = (int)PhysicsManager.BodyTypes.TRIGGER;
m_Body.MaterialGroupID = Core.Singleton.PhysicsManager.getMaterialID("Trigger");
}
示例2: NpcController
public NpcController(Mogre.Node node,Mogre.Entity entity,float mass)
: base(node, entity, mass)
{
m_MainBody.Type = (int)PhysicsManager.BodyTypes.NPC;
m_MainBody.MaterialGroupID = Core.Singleton.PhysicsManager.getMaterialID("NPC");
m_SecondBody.MaterialGroupID = Core.Singleton.PhysicsManager.getMaterialID("NPC");
}
示例3: GoToLocation
/// <summary>
/// Sends objects in the group to the given position. The objects are not sends to the same position,
/// the positions are prepeted around the given center point.
/// </summary>
/// <param name="group">The moving group.</param>
/// <param name="to">The point of the moving.</param>
public void GoToLocation(GroupMovables group, Mogre.Vector3 to)
{
var destinations = PreparePositions(group.Count, to);
foreach (IMovableGameObject imgo in group) {
imgo.SetNextLocation(destinations[0]);
destinations.RemoveAt(0);
}
}
示例4: SolarSystem
/// <summary>
/// Initializes dictionaries and sets the name and the position at Space of the SolarSystem.
/// </summary>
/// <param name="name">The name of the SolarSystem.</param>
/// <param name="position">The position of the SolarSystem.</param>
public SolarSystem(string name, Mogre.Vector3 position)
{
this.name = name;
this.position = position;
isgoObjectDict = new Dictionary<string, IStaticGameObject>();
imgoObjectDict = new Dictionary<string, IMovableGameObject>();
bulletDict = new Dictionary<string, IBullet>();
}
示例5: distanceBetweenPythagCartesian
/// <summary>
/// This is the Cartesian version of Pythagoras' theorem. In three-dimensional space,
/// the distance between points (x1,y1,z1) and (x2,y2,z2) is
/// http://upload.wikimedia.org/math/3/a/e/3ae1d79e0bfcc8f38223c7df4a7320c5.png
/// which can be obtained by two consecutive applications of Pythagoras' theorem.
/// http://en.wikipedia.org/wiki/Cartesian_coordinate_system#Distance_between_two_points
/// the square root of (
/// ((point2.x - point1.x)squared) +
/// ((point2.y - point1.y)squared) +
/// ((point2.z - point1.z)squared)
/// )
/// </summary>
public static float distanceBetweenPythagCartesian(Mogre.Vector3 point1, Mogre.Vector3 point2)
{
return Mogre.Math.Sqrt(
(Mogre.Math.Sqr(point2.x - point1.x) +
Mogre.Math.Sqr(point2.y - point1.y) +
Mogre.Math.Sqr(point2.z - point1.z)
));
}
示例6: __gl_meshCheckMesh
/* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
*/
public static void __gl_meshCheckMesh(Mogre.Utils.GluTesselator.GLUmesh mesh)
{
Mogre.Utils.GluTesselator.GLUface fHead = mesh.fHead;
Mogre.Utils.GluTesselator.GLUvertex vHead = mesh.vHead;
Mogre.Utils.GluTesselator.GLUhalfEdge eHead = mesh.eHead;
Mogre.Utils.GluTesselator.GLUface f, fPrev;
Mogre.Utils.GluTesselator.GLUvertex v, vPrev;
Mogre.Utils.GluTesselator.GLUhalfEdge e, ePrev;
fPrev = fHead;
for (fPrev = fHead; (f = fPrev.next) != fHead; fPrev = f)
{
//assert(f.prev == fPrev);
e = f.anEdge;
do
{
//assert(e.Sym != e);
//assert(e.Sym.Sym == e);
//assert(e.Lnext.Onext.Sym == e);
//assert(e.Onext.Sym.Lnext == e);
//assert(e.Lface == f);
e = e.Lnext;
}
while (e != f.anEdge);
}
//assert(f.prev == fPrev && f.anEdge == null && f.data == null);
vPrev = vHead;
for (vPrev = vHead; (v = vPrev.next) != vHead; vPrev = v)
{
//assert(v.prev == vPrev);
e = v.anEdge;
do
{
//assert(e.Sym != e);
//assert(e.Sym.Sym == e);
//assert(e.Lnext.Onext.Sym == e);
//assert(e.Onext.Sym.Lnext == e);
//assert(e.Org == v);
e = e.Onext;
}
while (e != v.anEdge);
}
//assert(v.prev == vPrev && v.anEdge == null && v.data == null);
ePrev = eHead;
for (ePrev = eHead; (e = ePrev.next) != eHead; ePrev = e)
{
//assert(e.Sym.next == ePrev.Sym);
//assert(e.Sym != e);
//assert(e.Sym.Sym == e);
//assert(e.Org != null);
//assert(e.Sym.Org != null);
//assert(e.Lnext.Onext.Sym == e);
//assert(e.Onext.Sym.Lnext == e);
}
//assert(e.Sym.next == ePrev.Sym && e.Sym == mesh.eHeadSym && e.Sym.Sym == e && e.Org == null && e.Sym.Org == null && e.Lface == null && e.Sym.Lface == null);
}
示例7: killtest
public void killtest(Mogre.Vector3 position)
{
Mogre.OverlayManager.Singleton.GetByName("BrokenScreen").Show();
Mogre.MaterialPtr mat = Mogre.MaterialManager.Singleton.GetByName("BrokenScreen");
Mogre.TextureUnitState tus = mat.GetTechnique(0).GetPass(0).GetTextureUnitState(0);
mat.GetTechnique(0).GetPass(0).SetSceneBlending(Mogre.SceneBlendType.SBT_TRANSPARENT_ALPHA);
tus.SetAlphaOperation(Mogre.LayerBlendOperationEx.LBX_MODULATE, Mogre.LayerBlendSource.LBS_MANUAL, Mogre.LayerBlendSource.LBS_TEXTURE, 1);
Core.Singleton.SoundDict.Play("die_01.wav", position);
}
示例8: BillboardSystem
public BillboardSystem(SceneManager sceneManager, SceneNode worldNode, string materialName, Mogre.BillboardType type, Vector2 defaultDimension, float defaultTimeToLive)
{
BillboardSet = sceneManager.CreateBillboardSet();
BillboardSet.SetMaterialName(materialName);
BillboardSet.SetBillboardsInWorldSpace(true);
BillboardSet.BillboardType = type;
worldNode.AttachObject(BillboardSet);
this.DefaultDimension = defaultDimension;
this.DefaultTimeToLive = defaultTimeToLive;
}
示例9: FrameRenderingQueued
public Boolean FrameRenderingQueued( Mogre.FrameEvent evt)
{
if( m_stateManager->getActiveState() )
m_stateManager->getActiveState()->updateFrameEvent( evt );
double time = evt.timeSinceLastFrame;
///// Bullet time tymczasowo wyci?ty
//if( m_keyStates[OIS.KC_B] )
// time = 0.3 * evt.timeSinceLastFrame;
//else
// time = 1.0 * evt.timeSinceLastFrame;
double tElapsed = m_elapsed += time;
double tUpdate = m_update;
// loop through and update as many times as necessary (up to 10 times maximum).
if ((tElapsed > tUpdate) && (tElapsed < (tUpdate * 10)) )
{
while (tElapsed > tUpdate)
{
//for( std.list<TimeObserver *>.iterator it = m_TimeObservers.begin(); it != m_TimeObservers.end(); it++ )
// (*it)->update( tUpdate );
m_stateManager->update( tUpdate );
tElapsed -= tUpdate;
}
}
else
{
if (tElapsed < tUpdate)
{
// not enough time has passed this loop, so ignore for now.
}
else
{
// too much time has passed (would require more than 10 updates!), so just update once and reset.
// this often happens on the first frame of a game, where assets and other things were loading, then
// the elapsed time since the last drawn frame is very long.
//for( std.list<TimeObserver *>.iterator it = m_TimeObservers.begin(); it != m_TimeObservers.end(); it++ )
// (*it)->update( tUpdate );
m_stateManager->update( tUpdate );
tElapsed = 0.0f; // reset the elapsed time so we don't become "eternally behind".
}
}
Core.Singleton().m_elapsed = tElapsed;
Core.Singleton().m_update = tUpdate;
//wstrzykiwanie uplywu czasu do CEgui
//CEGUI.System.getSingleton().injectTimePulse(evt.timeSinceLastFrame);
return true;
}
示例10: GetObjectProperties
public override void GetObjectProperties(Mogre.NameValuePairList retList)
{
base.GetObjectProperties(retList);
retList["MeshFile"] = this.meshFile;
retList["CastShadows"] = Mogre.StringConverter.ToString(this.castShadows);
for (int i = 0; i < this.subMeshes.Count; ++i)
{
string paramName = "SubEntity" + Mogre.StringConverter.ToString(i) + ".";
retList[paramName + "Visible"] = Mogre.StringConverter.ToString(this.subMeshes[i].Visible);
retList[paramName + "Material"] = this.subMeshes[i].Material;
}
}
示例11: SoundPlayer
private ISound sound; // Current playing song
#endregion Fields
#region Constructors
/// <summary>
/// Initializes music player and randomizer. After that plays first song
/// from file and sets event receiver.
/// </summary>
/// <param name="mWindow">The RenderWindow instance for making overlays</param>
public SoundPlayer( Mogre.RenderWindow mWindow)
{
engine = new ISoundEngine();
songs = Directory.GetFiles(songPath);
r = new Random();
this.mWindow = mWindow;
sound = engine.Play2D(songs[0]);
sound.setSoundStopEventReceiver(this);
ShowCurrentPlaying(songs[current]);
effects = new Dictionary<string, string>();
var tempEff = Directory.GetFiles(effectPath);
foreach (var effName in tempEff) {
var splited = effName.Split('\\');
effects.Add(splited[splited.Length - 1], effName);
}
}
示例12:
void MogitorsRoot.IDragDropHandler.OnDragDrop(DragData dragData, Mogre.Viewport vp, Mogre.Vector2 position)
{
if (dragData.Object != null)
{
Mogre.NameValuePairList parameters = new Mogre.NameValuePairList();
dragData.Object.GetObjectProperties(parameters);
dragData.Object.Destroy(false);
dragData.Object = null;
dragData.Parameters["Position"] = parameters["Position"];
MogitorsRoot.Instance.CreateEditorObject(null, dragData.ObjectType, dragData.Parameters, true, true);
}
dragData.Parameters.Clear();
dragData.ObjectType = "";
dragData.Object = null;
}
示例13: SetPhysics
public void SetPhysics(Mogre.Entity entity, Mogre.SceneNode node, float mass)
{
MogreNewt.ConvexCollision collision = new MogreNewt.CollisionPrimitives.Cylinder(
Core.Singleton.NewtonWorld,
Core.Singleton.PhysicsManager.getCollisionCylinderRadius(entity, node),
Core.Singleton.PhysicsManager.getCollisionCylinderHeight(entity, node),
new Mogre.Quaternion(new Mogre.Radian(1.57f), new Mogre.Vector3(0f, 0f, 1f)),
Core.Singleton.GetUniqueBodyId()
);
Mogre.Vector3 inertia, offset;
collision.CalculateInertialMatrix(out inertia, out offset);
inertia *= mass;
m_Body = new MogreNewt.Body(Core.Singleton.NewtonWorld, collision, true);
m_Body.AttachNode(node);
m_Body.SetMassMatrix(mass, inertia);
m_Body.SetPositionOrientation(node.Position + new Vector3(0, 1, 0), node.Orientation);
m_Body.MaterialGroupID = Core.Singleton.PhysicsManager.getMaterialID("Metal");
}
示例14: PriorityQHeap
/* really __gl_pqHeapNewPriorityQ */
public PriorityQHeap(Mogre.Utils.GluTesselator.PriorityQ.Leq leq)
{
size = 0;
max = Mogre.Utils.GluTesselator.PriorityQ.INIT_SIZE;
nodes = new Mogre.Utils.GluTesselator.PriorityQ.PQnode[Mogre.Utils.GluTesselator.PriorityQ.INIT_SIZE + 1];
for (int i = 0; i < nodes.Length; i++)
{
nodes[i] = new PQnode();
}
handles = new Mogre.Utils.GluTesselator.PriorityQ.PQhandleElem[Mogre.Utils.GluTesselator.PriorityQ.INIT_SIZE + 1];
for (int i = 0; i < handles.Length; i++)
{
handles[i] = new PQhandleElem();
}
initialized = false;
freeList = 0;
this.leq = leq;
nodes[1].handle = 1; /* so that Minimum() returns NULL */
handles[1].key = null;
}
示例15: MatrixTransform
//: this(towgs84, false)
public MatrixTransform(Mogre.Matrix4 reference_frame)
{
//copiar reference a la matrix v
v = new double[16];
v[0] = reference_frame.m00;
v[1] = reference_frame.m01;
v[2] = reference_frame.m02;
v[3] = reference_frame.m03;
v[4] = reference_frame.m10;
v[5] = reference_frame.m11;
v[6] = reference_frame.m12;
v[7] = reference_frame.m13;
v[8] = reference_frame.m20;
v[9] = reference_frame.m21;
v[10] = reference_frame.m22;
v[11] = reference_frame.m23;
v[12] = reference_frame.m30;
v[13] = reference_frame.m31;
v[14] = reference_frame.m32;
v[15] = reference_frame.m33;
}