本文整理汇总了C#中SceneNode.SetScale方法的典型用法代码示例。如果您正苦于以下问题:C# SceneNode.SetScale方法的具体用法?C# SceneNode.SetScale怎么用?C# SceneNode.SetScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SceneNode
的用法示例。
在下文中一共展示了SceneNode.SetScale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ForceBall
public ForceBall(SceneManager sceneManager, MogreNewt.World physicsWorld, float tempSize, int own)
{
MogreNewt.ConvexCollision col;
Mogre.Vector3 offset;
Mogre.Vector3 inertia;
unique++;
// Create the visible mesh (no physics)
ent = sceneManager.CreateEntity("forceball" + unique, "Sph.mesh");
sn = sceneManager.RootSceneNode.CreateChildSceneNode();
sn.AttachObject(ent);
Console.WriteLine("end ball create");
size = tempSize;
sn.SetScale(size, size, size);
// Create the collision hull
col = new MogreNewt.CollisionPrimitives.ConvexHull(physicsWorld, sn);
col.calculateInertialMatrix(out inertia, out offset);
// Create the physics body. This body is what you manipulate. The graphical Ogre scenenode is automatically synced with the physics body
body = new MogreNewt.Body(physicsWorld, col);
col.Dispose();
//body.setPositionOrientation(new Vector3(0, 10, 0), Quaternion.IDENTITY);
body.attachToNode(sn);
body.setContinuousCollisionMode(1);
body.setMassMatrix(mass, mass * inertia);
body.IsGravityEnabled = true;
body.setUserData(this);
trail = sceneManager.CreateParticleSystem("awesome" + StringConverter.ToString(unique), "Char/Smoke");
trail.CastShadows = true;
trail.GetEmitter(0).EmissionRate = 100;
sn.AttachObject(trail);
Console.WriteLine("player stuff");
owner = own;
Player tempP = (Player)Program.p1;
colour = tempP.cv;
}
示例2: LeftClicked
public void LeftClicked(float x, float y, string currentEntity)
{
// Save mouse position
mouseX = x; mouseY = y;
// Setup the ray scene query
Ray mouseRay = mCamera.GetCameraToViewportRay(mouseX, mouseY);
Ray newRay = new Ray(new Vector3(mouseRay.Origin.x, System.Math.Abs(mouseRay.Origin.y), mouseRay.Origin.z), mouseRay.Direction);
mRaySceneQuery.Ray = newRay;
// Execute query
RaySceneQueryResult result = mRaySceneQuery.Execute();
RaySceneQueryResult.Enumerator itr = (RaySceneQueryResult.Enumerator)result.GetEnumerator();
// Get results, create a node/entity on the position
if (itr != null && itr.MoveNext())
{
if (string.IsNullOrWhiteSpace(currentEntity))
return;
if (itr.Current != null && itr.Current.worldFragment != null)
{
Entity ent = mMgr.CreateEntity(currentEntity + mCount.ToString(), currentEntity);
mCurrentObject = mMgr.RootSceneNode.CreateChildSceneNode(currentEntity + "Node" + mCount.ToString(),
itr.Current.worldFragment.singleIntersection);
mCount++;
mCurrentObject.AttachObject(ent);
mCurrentObject.SetScale(scale);
}
} //
mLMouseDown = true;
return;
}