当前位置: 首页>>代码示例>>C#>>正文


C# SceneNode.SetScale方法代码示例

本文整理汇总了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;
        }
开发者ID:CharcoalStyles,项目名称:3DRL,代码行数:44,代码来源:Force+ball.cs

示例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;
        }
开发者ID:zinick,项目名称:Ogre3D-Level-Editor,代码行数:35,代码来源:OgreForm.cs


注:本文中的SceneNode.SetScale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。