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


C# SceneNode._setDerivedPosition方法代码示例

本文整理汇总了C#中SceneNode._setDerivedPosition方法的典型用法代码示例。如果您正苦于以下问题:C# SceneNode._setDerivedPosition方法的具体用法?C# SceneNode._setDerivedPosition怎么用?C# SceneNode._setDerivedPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SceneNode的用法示例。


在下文中一共展示了SceneNode._setDerivedPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BeginNextTask

        protected void BeginNextTask()
        {
            //If we're transitioning from a previous task, lets tear that shit down
            if (currentRenderTask != null)
                TearDownPreviousTask();

            if (currentRenderTask == null && renderTasks.Count == 0)
            {
                mShutDown = true;
                return;
            }

            //Dequeue the next task
            currentRenderTask = renderTasks.Dequeue();

            _playerEntity = mSceneMgr.CreateEntity(currentRenderTask.PlayerModelConfig.EntityName, currentRenderTask.PlayerModelConfig.ModelName);

            _playerNode = mSceneMgr.RootSceneNode.CreateChildSceneNode("PlayerNode");
            _playerNode.AttachObject(_playerEntity);
            _playerNode._setDerivedPosition(_playerNode.Position + new Vector3(0, -0.5f * _playerEntity.BoundingRadius, 0));

            //Set up name of dat animation collection
            var animationCollectionName = currentRenderTask.PlayerModelConfig.EntityName;
            switch (currentRenderTask.TaskType)
            {
                case TaskType.Item:
                    animationCollectionName += "_" + currentRenderTask.ItemConfig.EntityName;
                    break;
                case TaskType.Wearable:
                    animationCollectionName += "_" + currentRenderTask.WearableConfig.EntityName;
                    break;
            }

            mAnimationCollection = new AnimationCollection { Name = animationCollectionName };
            mStateIterator = _playerEntity.AllAnimationStates.GetAnimationStateIterator();

            if (_playerEntity != null)
            {
                switch (currentRenderTask.TaskType)
                {
                    case TaskType.Item:
                        {
                            _currentItem = mSceneMgr.CreateEntity(currentRenderTask.ItemConfig.EntityName,
                                                                  currentRenderTask.ItemConfig.ModelName);
                            var ic = currentRenderTask.ItemConfig;
                            _playerEntity.AttachObjectToBone(currentRenderTask.PlayerModelConfig.RHandBoneName, _currentItem,
                                                             new Quaternion(ic.QuatW, ic.QuatX, ic.QuatY, ic.QuatZ),
                                                             new Vector3(ic.OffsetX, ic.OffsetY, ic.OffsetZ));
                            //Make player entity transparent so all we see is the item
                            _playerEntity.SetMaterialName("transparent_mask");
                        }
                        break;
                    case TaskType.Wearable:
                        _playerEntity.SetMaterialName(currentRenderTask.WearableConfig.Material);
                        break;
                }
            }

            //_ent.SetMaterialName("Normal");
            /*
              var sub = _ent.GetSubEntity(0);
              sub.SetCustomParameter(CUSTOM_SHININESS, new Vector4(10.0f, 0.0f, 0.0f, 0.0f));
              sub.SetCustomParameter(CUSTOM_DIFFUSE, new Vector4(1.0f, 1.0f, 0.7f, 1.0f));
              sub.SetCustomParameter(CUSTOM_SPECULAR, new Vector4(1.0f, 1.0f, 1.0f, 1.0f));*/
            NextAnimation();
        }
开发者ID:MSylvia,项目名称:mspriterenderer,代码行数:66,代码来源:Program.cs


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