本文整理汇总了C#中SceneNode.Scale方法的典型用法代码示例。如果您正苦于以下问题:C# SceneNode.Scale方法的具体用法?C# SceneNode.Scale怎么用?C# SceneNode.Scale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SceneNode
的用法示例。
在下文中一共展示了SceneNode.Scale方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Barrel
public Barrel(string meshName, Vector3 v, float mass)
{
m_Entity = Core.Singleton.SceneManager.CreateEntity(meshName);
m_Node = Core.Singleton.SceneManager.RootSceneNode.CreateChildSceneNode();
m_Node.AttachObject(m_Entity);
m_Node.Scale(0.1f, 0.1f, 0.1f);
m_Node.Scale(new Vector3(0.3f, 0.3f, 0.3f));
// m_Node.Rotate(new Mogre.Quaternion(new Mogre.Radian(1.57f), new Mogre.Vector3(0f, 0f, 1f) ));
m_Node.SetPosition(v.x, v.y, v.z);
SetPhysics(m_Entity, m_Node, mass);
}
示例2: Stone
public Stone(ref SceneManager mSceneMgr, Vector3 position)
{
name = count.ToString();
ent = mSceneMgr.CreateEntity("stone"+name, "ogrehead.mesh");
ent.CastShadows = true;
isCarried = false;
node = mSceneMgr.RootSceneNode.CreateChildSceneNode("stoneNode"+name);
node.AttachObject(ent);
node.Position = position;
node.Scale(0.35f, 0.35f, 0.35f);
count++;
}
示例3: setupVideo
protected void setupVideo()
{
mCubeSceneNode = mSceneManager.RootSceneNode.CreateChildSceneNode("CubeNode",
new Vector3(0f, 0f, 0f));
// Create knot objects so we can see movement
// mCubeEntity = mSceneManager.CreateEntity("CubeShape", SceneManager.PrefabType.PT_CUBE);
mCubeEntity = mSceneManager.CreateEntity("CubeShape", SceneManager.PrefabType.PT_PLANE);
mCubeSceneNode.AttachObject(mCubeEntity);
mCubeSceneNode.Scale(1.5f, 1.5f, 1.5f);
mvideoWidth = 1024;
mvideoHeight = 768;
setTextureDimensions(false);
setupVideoGraphicsObject();
Thread lRenderVideoThread = new Thread(new ThreadStart(renderVideoThread));
lRenderVideoThread.Start();
cam = new Capture(Configuration.getConfiguration().TrainingVideoFile, "Test String", mParentWindow, false, new VideoUserOptions(),null);
cam.VideoBufferReceivedEvent += new Capture.OnVideoBufferReceivedEvent(OnVideoBufferReceivedEvent);
cam.Start();
}
示例4: CreateHeart
/// <summary>
/// This method initializes the heart node and entity
/// </summary>
/// <param name="n"> A numeric tag used to determine the heart postion on sceen </param>
/// <returns></returns>
private SceneNode CreateHeart(int n)
{
lifeEntity = mSceneMgr.CreateEntity("Heart.mesh");
lifeEntity.SetMaterialName("HeartHMD");
SceneNode livesNode;
livesNode = new SceneNode(mSceneMgr);
livesNode.AttachObject(lifeEntity);
livesNode.Scale(new Vector3(0.15f, 0.15f, 0.15f));
//livesNode.Position = new Vector3(3f, 3f, -8) - n * 0.5f * Vector3.UNIT_X; ;
livesNode.Position = new Vector3(3f, 3.5f, -5.5f) - n * 0.5f * Vector3.UNIT_X; ;
livesNode.SetVisible(true);
return livesNode;
}
示例5: CreateScene
// Scene creation
public override void CreateScene()
{
// Set ambient light
sceneMgr.AmbientLight = new ColourValue(0.2F, 0.2F, 0.2F);
// Create a skydome
sceneMgr.SetSkyDome(true, "Examples/CloudySky", 5, 8);
// Create a light
Light l = sceneMgr.CreateLight("MainLight");
// Accept default settings: point light, white diffuse, just set position
// NB I could attach the light to a SceneNode if I wanted it to move automatically with
// other objects, but I don't
l.Position = new Vector3(20F, 80F, 50F);
// Define a floor plane mesh
Plane p;
p.normal = Vector3.UNIT_Y;
p.d = 200;
MeshManager.Singleton.CreatePlane("FloorPlane", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, p, 200000F, 20000F, 20, 20, true, 1, 50F, 50F, Vector3.UNIT_Z);
Entity ent;
// Create an entity (the floor)
ent = sceneMgr.CreateEntity("floor", "FloorPlane");
ent.SetMaterialName("Examples/RustySteel");
// Attach to child of root node, better for culling (otherwise bounds are the combination of the 2)
sceneMgr.RootSceneNode.CreateChildSceneNode().AttachObject(ent);
// Add a head, give it it's own node
headNode = sceneMgr.RootSceneNode.CreateChildSceneNode();
ent = sceneMgr.CreateEntity("head", "cylinder.mesh");
//ent.SetMaterialName("materials/texturesRustySteel");
// y
// ^
// |
// x <---x z
headNode.AttachObject(ent);
headNode.Scale(2,10,10);
//headNode.Rotate(new Vector3(0,0,1), new Radian(Math.PI / 2F));
headNode.Rotate(new Vector3(0, 0, 1F), Math.HALF_PI);
// Make sure the camera track this node
//camera.SetAutoTracking(true, headNode);
// Create the camera node & attach camera
SceneNode camNode = sceneMgr.RootSceneNode.CreateChildSceneNode();
camNode.AttachObject(camera);
// set up spline animation of node
//Animation anim = sceneMgr.CreateAnimation("CameraTrack", 10F);
// Spline it for nice curves
//anim.SetInterpolationMode(Animation.InterpolationMode.IM_SPLINE);
//// Create a track to animate the camera's node
//NodeAnimationTrack track = anim.CreateNodeTrack(0, camNode);
//// Setup keyframes
//TransformKeyFrame key = track.CreateNodeKeyFrame(0F); // startposition
//key = track.CreateNodeKeyFrame(2.5F);
//key.Translate = new Vector3(500F, 500F, -1000F);
//key = track.CreateNodeKeyFrame(5F);
//key.Translate = new Vector3(-1500F, 1000F, -600F);
//key = track.CreateNodeKeyFrame(7.5F);
//key.Translate = new Vector3(0F, 100F, 0F);
//key = track.CreateNodeKeyFrame(10F);
//key.Translate = new Vector3(0F, 0F, 0F);
//// Create a new animation state to track this
//animState = sceneMgr.CreateAnimationState("CameraTrack");
//animState.Enabled = true;
// Put in a bit of fog for the hell of it
//sceneMgr.SetFog(FogMode.FOG_EXP, ColourValue.White, 0.0002F);
}
示例6: Load
/// <summary>
/// This method load the bomb mesh and its physics object
/// </summary>
private void Load()
{
removeMe = false;
bombEntity = mSceneMgr.CreateEntity("Bomb.mesh");
bombNode = mSceneMgr.CreateSceneNode();
bombNode.Scale(2, 2, 2);
bombNode.AttachObject(bombEntity);
mSceneMgr.RootSceneNode.AddChild(bombNode);
physObj = new PhysObj(10, "Bomb", 0.1f, 0.5f);
physObj.SceneNode = bombNode;
physObj.AddForceToList(new WeightForce(physObj.InvMass));
Physics.AddPhysObj(physObj);
}