本文整理汇总了C#中IrrlichtNETCP.SceneNode类的典型用法代码示例。如果您正苦于以下问题:C# SceneNode类的具体用法?C# SceneNode怎么用?C# SceneNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SceneNode类属于IrrlichtNETCP命名空间,在下文中一共展示了SceneNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Sea
public Sea(Viewer viewer, SceneNode _parentNode)
: base(viewer, -1, _parentNode)
{
shaderDirectory = Util.ApplicationDataDirectory + @"\media\shaders\";
modelDirectory = Util.ApplicationDataDirectory + @"\media\models\";
textureDirectory = Util.ApplicationDataDirectory + @"\media\textures\";
}
示例2: GrassPatchSceneNode
public GrassPatchSceneNode(SceneNode parent, SceneManager mgr, int id, bool createIfEmpty,
Vector3D gridPos, string filepath, Texture heightMap, Texture colourMap,
Texture grassMap, SceneNode terrain, WindGenerator wind)
: base(parent, mgr, id)
{
DrawDistance = GRASS_PATCH_SIZE * 1.5f;
MaxDensity = 800;
TerrainHeightMap = heightMap;
TerrainColourMap = colourMap;
TerrainGrassMap = grassMap;
Terrain = terrain;
WindGen = wind;
lastwindtime = 0;
lastdrawcount = 0;
redrawnextloop = true;
MaxFPS = 0;
_mgr = mgr;
WindRes = 5;
filename = string.Format("{0}/{1}.{2}.grass", filepath, gridpos.X, gridpos.Z);
gridpos = gridPos;
Position = new Vector3D(gridpos.X * GRASS_PATCH_SIZE, 0f,
gridpos.Z * GRASS_PATCH_SIZE);
ImageCount = new Dimension2D(4, 2);
if (!Load())
Create(createIfEmpty);
}
示例3: DirectionalLight
public DirectionalLight(Viewer viewer, SceneNode _parentNode, string _name)
: base(viewer, -1)
{
parentNode = _parentNode;
rotation = new Vector3D();
name = _name;
}
示例4: Load
public override void Load()
{
node = Render.Scene.AddSphereSceneNode(0.1f, 32, Root);
node.SetMaterialFlag(MaterialFlag.Lighting, true);
base.Load();
}
示例5: AnimateNode
public override void AnimateNode(SceneNode node, uint timeMs)
{
Vector3D NewRotation = node.Rotation;
NewRotation += Rotation* ((timeMs-StartTime)/10.0f);
node.Rotation = (NewRotation);
StartTime = timeMs;
}
示例6: AbsoluteMatrix
public static Matrix4 AbsoluteMatrix(SceneNode bone)
{
Matrix4 mat = bone.RelativeTransformation;
if (bone.Parent != null)
mat *= AbsoluteMatrix(bone.Parent);
return mat;
}
示例7: LaserDataSceneNode
public LaserDataSceneNode(SceneNode parent, SceneManager mgr, int id)
: base(parent, mgr, id)
{
_mgr = mgr;
_driver = _mgr.VideoDriver;
Material.Wireframe = false;
Material.Lighting = false;
create_mesh();
}
示例8: AddTextSceneNodeW
public TextSceneNode AddTextSceneNodeW(GUIFont font, string text, Color color, SceneNode parent)
{
IntPtr par = IntPtr.Zero;
if (parent != null)
par = parent.Raw;
#if !LINUX
return (TextSceneNode)
NativeElement.GetObject(SceneManager_AddTextSceneNodeW(_raw, font.Raw, text, color.ToUnmanaged(), par),
typeof(TextSceneNode));
#else
return (TextSceneNode)
NativeElement.GetObject(SceneManager_AddTextSceneNode(_raw, font.Raw, text, color.ToUnmanaged(), par),
typeof(TextSceneNode));
#endif
}
示例9: WaterSceneNode
public WaterSceneNode(SceneNode parent, SceneManager mgr, Dimension2Df tileSize,
Dimension2D tileCount, Dimension2D precision, int id) :
base(parent, mgr, id)
{
_scene = mgr;
_driver = mgr.VideoDriver;
AnimatedMesh wmesh = _scene.AddHillPlaneMesh("watermesh" + _current,
tileSize,
tileCount, 0,
new Dimension2Df(0, 0),
new Dimension2Df(1, 1));
_current++;
int dmat = (int)MaterialType.Reflection2Layer;
if(_driver.DriverType == DriverType.OpenGL)
dmat = _driver.GPUProgrammingServices.AddHighLevelShaderMaterial(
WATER_VERTEX_GLSL, "main", VertexShaderType._1_1, WATER_FRAGMENT_GLSL,
"main", PixelShaderType._1_1, OnShaderSet, MaterialType.TransparentAlphaChannel, 0);
else
dmat = _driver.GPUProgrammingServices.AddHighLevelShaderMaterial(
WATER_HLSL, "vertexMain", VertexShaderType._2_0, WATER_HLSL,
"pixelMain", PixelShaderType._2_0, OnShaderSet, MaterialType.TransparentAlphaChannel, 2);
if (_driver.DriverType == DriverType.OpenGL)
ClampShader = _driver.GPUProgrammingServices.AddHighLevelShaderMaterial(
CLAMP_VERTEX_GLSL, "main", VertexShaderType._1_1, CLAMP_FRAGMENT_GLSL,
"main", PixelShaderType._1_1, OnShaderSet, MaterialType.TransparentAlphaChannel, 1);
else
ClampShader = _driver.GPUProgrammingServices.AddHighLevelShaderMaterial(
CLAMP_HLSL, "vertexMain", VertexShaderType._2_0, CLAMP_HLSL,
"pixelMain", PixelShaderType._2_0, OnShaderSet, MaterialType.TransparentAlphaChannel, 3);
_waternode = _scene.AddMeshSceneNode(wmesh.GetMesh(0), this, -1);
_waternode.SetMaterialType(dmat);
_waternode.SetMaterialFlag(MaterialFlag.BackFaceCulling, false);
_waternode.SetMaterialFlag(MaterialFlag.Lighting, false);
_waternode.SetMaterialFlag(MaterialFlag.FogEnable, false);
_rt = _driver.CreateRenderTargetTexture(precision);
_waternode.SetMaterialTexture(0, _rt);
CameraSceneNode oldcam = _scene.ActiveCamera;
_fixedcam = _scene.AddCameraSceneNode(null);
if(oldcam != null)
_scene.ActiveCamera = oldcam;
}
示例10: ATMOSkySceneNode
public ATMOSkySceneNode(Texture tex, SceneNode parent, SceneManager mgr, int faces, int id)
: base(parent, mgr, id)
{
smgr = mgr;
AutomaticCulling = CullingType.Off;
material = new Material();
material.Lighting = false;
material.ZBuffer = 0;
material.Texture1 = tex;
face = faces;
vertices = new Vertex3D[face + 1];
indices = new ushort[face * 3];
double angle = 0.0f;
double angle2 = 360.0f / face;
vert = 0; //vertice nr
int nr = -3; //indices nr
vertices[0] = new Vertex3D(Vector3D.From(0.0f, 100.0f, 0.0f),
Vector3D.From(0.0568988f, 0.688538f, -0.722965f),
Color.White,
Vector2D.From(0.0f, 0.1f)
);
double x, z;
for (ushort n = 1; n < face + 1; n++)
{
vert++;
nr += 3;
x = Math.Cos(angle * 0.017453292519943295769236907684886f) * 100;
z = Math.Sin(angle * 0.017453292519943295769236907684886f) * 100;
vertices[vert] = new Vertex3D(Vector3D.From((float)x, -5.0f, (float)z),
Vector3D.From(0.0568988f, 0.688538f, -0.722965f),
Color.White,
Vector2D.From(0.0f, 0.9f)
);
angle = angle + angle2;
indices[nr] = 0;
indices[nr + 1] = (ushort)vert;
indices[nr + 2] = (ushort)(vert + 1);
}
indices[nr + 2] = 1;
}
示例11: CustomSceneNode
public CustomSceneNode(SceneNode parent, SceneManager mgr, int id)
: base(parent, mgr, id)
{
_mgr = mgr;
_driver = _mgr.VideoDriver;
Material.Wireframe = false;
Material.Lighting = false;
Vertices[0] = new Vertex3D(new Vector3D(0, 0, 10), new Vector3D(1, 1, 0), Color.From(255, 0, 255, 255), new Vector2D(0, 1));
Vertices[1] = new Vertex3D(new Vector3D(10, 0, -10), new Vector3D(1, 0, 0), Color.From(255, 255, 0, 255), new Vector2D(1, 1));
Vertices[2] = new Vertex3D(new Vector3D(0, 20, 0), new Vector3D(0, 1, 1), Color.From(255, 255, 255, 0), new Vector2D(1, 0));
Vertices[3] = new Vertex3D(new Vector3D(-10, 0, -10), new Vector3D(0, 0, 1), Color.From(255, 0, 255, 0), new Vector2D(0, 0));
Box = new Box3D();
for (int i = 0; i < Vertices.Length; i++)
Box.AddInternalPoint(Vertices[i].Position);
}
示例12: LensflareSceneNode
public LensflareSceneNode(SceneNode parent, SceneManager mgr, int id, Vector3D position)
: base(parent, mgr, id)
{
draw_flare = true;
ign_geom = false;
smgr = mgr;
indices = new ushort[6];
indices[0] = 0;
indices[1] = 2;
indices[2] = 1;
indices[3] = 0;
indices[4] = 3;
indices[5] = 2;
vertices = new Vertex3D[4];
for (int i = 0; i < 4; i++)
{
vertices[i] = new Vertex3D();
}
vertices[0].TCoords = Vector2D.From(0.0f, 1.0f);
vertices[0].Color = Color.White;
vertices[1].TCoords = Vector2D.From(0.0f, 0.0f);
vertices[1].Color = Color.White;
vertices[2].TCoords = Vector2D.From(1.0f, 0.0f);
vertices[2].Color = Color.White;
vertices[3].TCoords = Vector2D.From(1.0f, 1.0f);
vertices[3].Color = Color.White;
material = new Material();
material.Lighting = false;
material.MaterialType = MaterialType.TransparentAddColor;
material.ZBuffer = 0;
material.ZWriteEnable = false;
bbox = new Box3D();
bbox.MinEdge = Vector3D.From(-2, -2, -2);
bbox.MaxEdge = Vector3D.From(2, 2, 2);
}
示例13: Initialize
public override void Initialize()
{
base.Initialize();
// Set title camera
System.Type type = this.GetType();
camera = Render.Scene.AddCameraSceneNode(Render.Scene.RootSceneNode);
camera.Position = new Vector3D(0, 0, -256);
camera.Target = new Vector3D(0, 0, 0);
camera.UpVector = new Vector3D(0, 0, 1);
camera.Name = type.FullName + ".Camera" ;
root = Render.Scene.AddEmptySceneNode(Render.Scene.RootSceneNode, -1);
root.Name = type.FullName + ".Root";
CreateTitle();
}
示例14: BeamNode
public BeamNode(SceneNode parent, SceneManager mgr, int id, string szBeam)
: base(parent, mgr, id)
{
smgr = mgr;
driver = smgr.VideoDriver;
Material = new Material();
// Setup the beam material
Material.Wireframe = false;
Material.Lighting = false;
Material.MaterialType = MaterialType.TransparentAlphaChannel;
Material.Texture1 = mgr.VideoDriver.GetTexture(szBeam);
// Default to 32 units for the scale
flScale = 32.0f;
// Default to white
beamColor.Set(255, 255, 255, 255);
}
示例15: AnimateNode
public override void AnimateNode(SceneNode p_node, uint p_currentTimeMs)
{
if (m_startTime == 0)
{
m_startTime = p_currentTimeMs;
}
if (p_currentTimeMs - m_startTime <= m_durationMs)
{
Vector3D t_currRotation = p_node.Rotation;
t_currRotation = m_rotationStart.GetInterpolated(m_rotationEnd, (p_currentTimeMs - m_startTime) / (float)m_durationMs);
p_node.Rotation = (t_currRotation);
//m_startTime = p_currentTimeMs;
}
else
{
p_node.Rotation = m_rotationEnd;
this.Null();
}
}