本文整理汇总了C#中SceneNode.Yaw方法的典型用法代码示例。如果您正苦于以下问题:C# SceneNode.Yaw方法的具体用法?C# SceneNode.Yaw怎么用?C# SceneNode.Yaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SceneNode
的用法示例。
在下文中一共展示了SceneNode.Yaw方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ThirdPersonModel
public ThirdPersonModel(Character character, SceneNode characterNode, string[] bodyEntityNames)
: base(character)
{
BodyEntities = bodyEntityNames.Select(name => Character.World.Scene.CreateEntity(name)).ToArray();
BodyNode = characterNode.CreateChildSceneNode();
BodyNode.Yaw(MathHelper.Pi);
WeaponSceneNode = BodyNode.CreateChildSceneNode();
WeaponCenterNode = WeaponSceneNode.CreateChildSceneNode();
foreach (Entity bodyEntity in BodyEntities)
{
BodyNode.AttachObject(bodyEntity);
// To play multiple animations that does not affect each other,
// blending mode cannot be average.
if (bodyEntity.HasSkeleton)
bodyEntity.Skeleton.BlendMode = SkeletonAnimationBlendMode.ANIMBLEND_CUMULATIVE;
}
WeaponCenterNode.Yaw(MathHelper.Pi);
}
示例2: CreateSimNode
public override void CreateSimNode()
{
enabled = true;
state.SceneManager.DestroyEntity("SubNode");
state.SceneManager.DestroyLight("subLight");
Entity sub = state.SceneManager.CreateEntity("SubNode", @"MockSub.mesh");
var sceneNode = new SceneNode(state.SceneManager);
sceneNode.AttachObject(sub);
sceneNode.Yaw(Math.HALF_PI);
SimNode = new SimNode(state.SceneManager.RootSceneNode, sceneNode);
Light subLight = state.SceneManager.CreateLight("subLight");
subLight.Type = Light.LightTypes.LT_SPOTLIGHT;
subLight.Direction = new Vector3(0, 0, -1);
subLight.SpotlightOuterAngle = new Radian(0.4F);
subLight.SpotlightInnerAngle = new Radian(0.2F);
subLight.SpotlightFalloff = 100.0F;
subLight.SetAttenuation(100, 0F, 0.0F, 0.01F);
SimNode.SceneNode.AttachObject(subLight);
SimNode.SceneNode.Position = new Vector3(0, 0, 20);
}
示例3: ChangeVisible
/// <summary>
/// Changes the bullet visibility. Visible is true -> Creates SceneNode and checks Entity (if is null -> initializes).
/// Visible is false -> Destroys SceneNode and save actual position.
/// </summary>
public virtual void ChangeVisible(bool visible)
{
if (visible && sceneNode == null) {
// Controls if the entity is inicialized
if (entity == null) {
entity = Game.SceneManager.CreateEntity(name, mesh);
}
sceneNode = Game.SceneManager.RootSceneNode.CreateChildSceneNode(name + "Node", position);
sceneNode.AttachObject(entity);
Vector3 src = sceneNode.Orientation * Vector3.NEGATIVE_UNIT_Z;
// SceneNode rotation
if ((1.0f + src.DotProduct(direction)) < 0.0001f) {
sceneNode.Yaw(new Angle(180.0f));
} else {
Quaternion quat = src.GetRotationTo(direction);
sceneNode.Rotate(quat);
}
} else {
if (sceneNode != null) {
position = sceneNode.Position;
Game.SceneManager.DestroySceneNode(sceneNode);
sceneNode = null;
}
}
}
示例4: WallPlane1
/// <summary>
/// This method generates a plane in an Entity which will be used as a wall
/// </summary>
private void WallPlane1()
{
plane1 = new Plane(Vector3.UNIT_X, -0);
MeshPtr wallMeshPtr = MeshManager.Singleton.CreatePlane("wall1",
ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, plane1, wallWidth,
wallHeight, wallXSegs, wallZSegs, true, 1, uTiles, vTiles,
Vector3.UNIT_Z);
wallEntity1 = mSceneMgr.CreateEntity("wall1");
wallNode1 = mSceneMgr.CreateSceneNode();
wallNode1.Translate(new Vector3(500, 000, 000));
wallNode1.Yaw(bob);
wallNode1.AttachObject(wallEntity1);
mSceneMgr.RootSceneNode.AddChild(wallNode1);
//wallEntity.SetMaterialName("Meteor");
}