本文整理汇总了C#中Axiom.Core.SceneManager类的典型用法代码示例。如果您正苦于以下问题:C# SceneManager类的具体用法?C# SceneManager怎么用?C# SceneManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SceneManager类属于Axiom.Core命名空间,在下文中一共展示了SceneManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SmoothCamera
public SmoothCamera(String pName, SceneManager pSceneManager, MovingObject pTarget, Int32 pFramesBehind)
: base(pName, pSceneManager)
{
Node = pSceneManager.RootSceneNode.CreateChildSceneNode();
Node.Position = cameraOffset;
Node.AttachObject(this);
x = new List<double>(pFramesBehind);
y = new List<double>(pFramesBehind);
dx = new List<double>(pFramesBehind);
dy = new List<double>(pFramesBehind);
framesBehind = Math.Max(1, pFramesBehind);
target = pTarget;
for (var i = 0; i < pFramesBehind; i++)
{
x.Add(pTarget.Position.x);
y.Add(pTarget.Position.y);
dx.Add(0);
dy.Add(0);
}
x.Insert(0, pTarget.Position.x);
y.Insert(0, pTarget.Position.y);
dx.Insert(0, pTarget.Velocity.x);
dy.Insert(0, pTarget.Velocity.y);
isYawFixed = true;
FixedYawAxis = Vector3.UnitZ;
Near = 5;
AutoAspectRatio = true;
}
示例2: PCZCamera
public PCZCamera( string name, SceneManager sceneManager )
: base( name, sceneManager )
{
this.box = new AxisAlignedBox( new Vector3( -0.1f, -0.1f, -0.1f ), new Vector3( 0.1f, 0.1f, 0.1f ) );
this.extraCullingFrustum = new PCZFrustum();
this.extraCullingFrustum.SetUseOriginPlane( true );
}
示例3: World
public World(SceneManager pSceneManager)
{
SceneManager = pSceneManager;
Ships = new List<Ship>(48);
Bullets = new List<Bullet>(256);
Trails = new List<Trail>(256);
}
示例4: Clipmap
public Clipmap(SceneManager scene)
{
_scene = scene;
_scene.QueueStarted += (sender, args) =>
{
if (args.RenderQueueId == _scene.GetRenderQueue().DefaultRenderGroup)
QueuePatches(_scene.GetRenderQueue());
args.SkipInvocation = false;
};
using (var testMap = (Bitmap)Image.FromFile(@"height.jpg"))
{
_testMapWidth = testMap.Width;
_testMapHeight = testMap.Height;
_testMap = new float[_testMapWidth * _testMapHeight];
var i = 0;
for (var y = 0; y < testMap.Height; y++)
for (var x = 0; x < testMap.Width; x++)
_testMap[i++] = testMap.GetPixel(x, y).R / 255.0f;
}
var tu = _shader.Sampler(() => _shader.Heightmap);
tu.DesiredFormat = PixelFormat.FLOAT32_RGB;
tu.SetTextureFiltering(FilterOptions.Point, FilterOptions.Point, FilterOptions.None);
tu.SetTextureAddressingMode(TextureAddressing.Wrap);
tu.BindingType = TextureBindingType.Vertex;
_shader.SetAuto(() => _shader.ModelViewProjectionMatrix, GpuProgramParameters.AutoConstantType.WorldViewProjMatrix);
//_shader.SetAuto(() => _shader.NormalMatrix, GpuProgramParameters.AutoConstantType.ACT_INVERSE_TRANSPOSE_WORLDVIEW_MATRIX);
_shader.SetAuto(() => _shader.ScaleFactor, GpuProgramParameters.AutoConstantType.Custom, 0);
_shader.SetAuto(() => _shader.FineBlockOrigin, GpuProgramParameters.AutoConstantType.Custom, 1);
Position = new IntFloatVector2(new IntFloat(-_testMapWidth / 4), new IntFloat(-_testMapHeight / 4));
Locations = new PatchLocations(H, M);
var scale = Scale;
var scaleInt = 1;
for (var i = 0; i < Levels; i++)
{
_levels[i] = new ClipmapLevel(scale, scaleInt, this);
var level = _levels[i];
tu.SetTextureName(level.Heightmap.Name);
var m = _shader.CloneMaterial("ClipmapLevel" + i);
_levels[i].Material = m;
scale *= 2.0f;
scaleInt *= 2;
}
UpdatePosition();
Reset();
_initialized = true;
}
示例5: OnLoad
public void OnLoad()
{
var dir = Directory.GetCurrentDirectory();
ResourceGroupManager.Instance.AddResourceLocation(dir, "Folder");
//MaterialManager.Instance.Initialize();
_scene = _root.CreateSceneManager("DefaultSceneManager", "SLSharpInstance");
_scene.ClearScene();
Bindings.Axiom.SLSharp.Init();
Shader.DebugMode = true;
//Shader.DebugMode = true;
_clipmap = new Clipmap(_scene);
RecalcHeight();
_camera = _scene.CreateCamera("MainCamera");
_camera.Position = new Vector3(0, 0, 5);
_camera.LookAt(Vector3.Zero);
_camera.Near = 0.001f;
_camera.Far = 20.0f;
_camera.AutoAspectRatio = true;
var vp = _window.AddViewport(_camera);
vp.BackgroundColor = ColorEx.CornflowerBlue;
}
示例6: 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);
}
}
示例7: PCZSceneNode
public PCZSceneNode( SceneManager creator, string name )
: base( creator, name )
{
homeZone = null;
anchored = false;
allowedToVisit = true;
lastVisibleFrame = 0;
lastVisibleFromCamera = null;
enabled = true;
}
示例8: PCZSceneNode
public PCZSceneNode( SceneManager creator, string name )
: base( creator, name )
{
this.homeZone = null;
this.anchored = false;
AllowToVisit = true;
LastVisibleFrame = 0;
LastVisibleFromCamera = null;
Enabled = true;
}
示例9: PointLight
public PointLight(WorldEditor worldEditor, IWorldContainer parent, SceneManager scene, string name, ColorEx specular, ColorEx diffuse, Vector3 position)
{
this.app = worldEditor;
this.parent = parent;
this.scene = scene;
this.name = name;
this.position = position;
this.specular = specular;
this.diffuse = diffuse;
this.terrainOffset = app.Config.DefaultPointLightHeight;
}
示例10: Region
public Region(StaticGeometry parent, string name, SceneManager mgr, UInt32 regionID, Vector3 center)
{
this.parent = parent;
this.name = name;
this.sceneMgr = mgr;
this.regionID = regionID;
this.center = center;
queuedSubMeshes = new List<QueuedSubMesh>();
lodSquaredDistances = new List<float>();
aabb = new AxisAlignedBox();
lodBucketList = new List<LODBucket>();
shadowRenderables = new ShadowRenderableList();
}
示例11: ManagerContainsNode
private static bool ManagerContainsNode( SceneManager sceneManager, SceneNode childNode )
{
bool managerContainsChild = false;
foreach ( SceneNode sceneNode in sceneManager.SceneNodes )
{
if ( sceneNode.Equals( childNode ) )
{
managerContainsChild = true;
}
}
return managerContainsChild;
}
示例12: DisplayParticleSystem
public DisplayParticleSystem(String name, SceneManager scene, string particleSystemName, Vector3 position, Vector3 scale, Vector3 rotation, float velocityScale, float particleScale)
{
this.name = name;
this.scene = scene;
this.particleSystemName = particleSystemName;
this.position = position;
this.scale = scale;
this.rotation = rotation;
this.particleScale = particleScale;
this.velocityScale = velocityScale;
attached = false;
AddToScene();
}
示例13: SceneManagerEnumerator
/// <summary>
/// Internal constructor. This class cannot be instantiated externally.
/// </summary>
internal SceneManagerEnumerator()
{
if (instance == null) {
instance = this;
// by default, use the standard scene manager.
defaultSceneManager = new SceneManager("Default Scene Manager");
// by default, all scenetypes use the default Scene Manager. Note: These can be overridden by plugins.
SetSceneManager(SceneType.Generic, defaultSceneManager);
SetSceneManager(SceneType.ExteriorClose, defaultSceneManager);
SetSceneManager(SceneType.ExteriorFar, defaultSceneManager);
SetSceneManager(SceneType.Interior, defaultSceneManager);
SetSceneManager(SceneType.Overhead, defaultSceneManager);
}
}
示例14: OnLoad
public void OnLoad()
{
//ResourceGroupManager.Instance.AddResourceLocation("media", "Folder", true);
_root.SceneManager = _sceneManager = _root.CreateSceneManager(SceneType.ExteriorClose);
_sceneManager.ClearScene();
_camera = _sceneManager.CreateCamera("MainCamera");
_camera.Position = new Vector3(0, 0, 500);
_camera.LookAt(new Vector3(0, 0, -300));
_camera.Near = 5;
_camera.AutoAspectRatio = true;
_camera.FieldOfView = 0.70f;
_viewport = _renderWindow.AddViewport(_camera, 0, 0, 1.0f, 1.0f, 100);
_viewport.BackgroundColor = ColorEx.Black; ;
_light = _sceneManager.CreateLight("light1");
_light.Type = LightType.Directional;
_light.Position = new Vector3(0, 150, 300);
_light.Diffuse = ColorEx.Blue;
_light.Specular = ColorEx.Blue;
//_light.Direction = new Vector3(0, 0, -300);
_sceneManager.AmbientLight = ColorEx.White;// new ColorEx(0.2f, 0.2f, 0.2f);
ResourceGroupManager.Instance.InitializeAllResourceGroups();
_inputReader = PlatformManager.Instance.CreateInputReader();
_inputReader.Initialize(_renderWindow, true, true, false, false);
_inputReader.UseKeyboardEvents = true;
_inputReader.UseMouseEvents = false;
//_renderItems.Add(new BasicCube());
_renderItems.Add(new CubeBrowser());
foreach (var i in _renderItems)
{
i.Initialise(_root);
}
}
示例15: Ship
public Ship(SceneManager pSceneManager, Controller pController)
: base(pController)
{
var name = Methods.GenerateUniqueID.ToString();
Node = pSceneManager.RootSceneNode.CreateChildSceneNode(name);
MeshNode = Node.CreateChildSceneNode();
MeshNode.Orientation = new Quaternion(0.5, 0.5, -0.5, -0.5);
MeshNode.AttachObject(pSceneManager.CreateEntity(name, "ship_assault_1.mesh"));
UpgradeGroup = new UpgradeGroup
{
CannonAutoFire = { Level = 10 },
CannonMultiFire = { Level = 10 },
CannonSpeed = { Level = 7 },
CannonPower = { Level = 5 }
};
cannon = new Cannon(this);
UpgradeGroup.UpgradeCannon(ref cannon, UpgradeGroup);
}