本文整理汇总了C#中Axiom.Core.SceneNode.SetDirection方法的典型用法代码示例。如果您正苦于以下问题:C# SceneNode.SetDirection方法的具体用法?C# SceneNode.SetDirection怎么用?C# SceneNode.SetDirection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axiom.Core.SceneNode
的用法示例。
在下文中一共展示了SceneNode.SetDirection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MultiLights
public MultiLights(SceneManager pSceneManager, SceneNode pCamNode, MovingObject pPlayerShip, Int32 pNumberOfLights)
{
oldCamLightColor = CamLightColor = new ColorEx(0.13f, 0.1f, 0.05f);
PlayerLightColor = ColorEx.White;
camLights = new List<Light>(pNumberOfLights);
innerLights = (Int32)Math.Round(pNumberOfLights / 3.0f, MidpointRounding.AwayFromZero);
outerLights = pNumberOfLights - innerLights;
// create the playership's light.
playerLight = pSceneManager.CreateLight("playerSpotLight");
playerLight.Type = LightType.Spotlight;
playerLight.Diffuse = PlayerLightColor;
playerLight.Specular = ColorEx.White;
playerLight.SetSpotlightRange(0.0f, 120.0f);
playerLight.Direction = Vector3.NegativeUnitZ;
playerLightNode = pPlayerShip.Node.CreateChildSceneNode();
playerLightNode.AttachObject(playerLight);
playerLightNode.Position = new Vector3(0, 0, 0);
playerLightNode.SetDirection(new Vector3(1, 0, 0), TransformSpace.Local);
// create the camera spotlights around the camera's direction.
camInnerLightNode = pCamNode.CreateChildSceneNode();
camInnerLightNode.Position = new Vector3(0, 0, 0);
camOuterLightNode = pCamNode.CreateChildSceneNode();
camOuterLightNode.Position = new Vector3(0, 0, 0);
for (var i = 0; i < innerLights; i++)
{
var light = pSceneManager.CreateLight("camInnerLight " + (i + 1));
light.Type = LightType.Spotlight;
light.Diffuse = CamLightColor;
light.Specular = ColorEx.White;
light.SetSpotlightRange(0.0f, 25.0f);
light.Direction = Quaternion.FromAngleAxis(360.0 * i / innerLights * Constants.DegreesToRadians, Vector3.UnitZ) *
Quaternion.FromAngleAxis(10.0 * Constants.DegreesToRadians, Vector3.UnitX) *
Vector3.NegativeUnitZ;
camLights.Add(light);
camInnerLightNode.AttachObject(light);
}
for (var i = 0; i < outerLights; i++)
{
var light = pSceneManager.CreateLight("camOuterLight " + (i + 1));
light.Type = LightType.Spotlight;
light.Diffuse = CamLightColor;
light.Specular = ColorEx.White;
light.SetSpotlightRange(0.0f, 25.0f);
light.Direction = Quaternion.FromAngleAxis(360.0 * i / outerLights * Constants.DegreesToRadians, Vector3.UnitZ) *
Quaternion.FromAngleAxis(20.0 * Constants.DegreesToRadians, Vector3.UnitX) *
Vector3.NegativeUnitZ;
camLights.Add(light);
camOuterLightNode.AttachObject(light);
}
}