本文整理汇总了C#中IrrlichtNETCP.Vector3D.ToUnmanaged方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3D.ToUnmanaged方法的具体用法?C# Vector3D.ToUnmanaged怎么用?C# Vector3D.ToUnmanaged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IrrlichtNETCP.Vector3D
的用法示例。
在下文中一共展示了Vector3D.ToUnmanaged方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetScreenCoordinatesFrom3DPosition
public Position2D GetScreenCoordinatesFrom3DPosition(Vector3D position, CameraSceneNode camera)
{
IntPtr cam = (camera == null ? IntPtr.Zero : camera.Raw);
int[] sc = new int[2];
SceneCollisionManager_GetScreenCoordinatesFrom3DPosition(_raw, position.ToUnmanaged(), cam, sc);
return Position2D.FromUnmanaged(sc);
}
示例2: GetCollisionResultPoint
public Vector3D GetCollisionResultPoint(TriangleSelector selector, Vector3D ellipsoidPosition, Vector3D ellipsoidRadius, Vector3D ellipsoidDirectionAndSpeed, out Triangle3D outTriangle, out bool outFalling, float slidingSpeed, Vector3D gravityDirectionAndSpeed)
{
float[] outtri = new float[9];
float[] outpos = new float[3];
outFalling = false;
SceneCollisionManager_GetCollisionResultPoint(_raw, selector.Raw, ellipsoidPosition.ToUnmanaged(), ellipsoidRadius.ToUnmanaged(), ellipsoidDirectionAndSpeed.ToUnmanaged(), outtri, ref outFalling, slidingSpeed, gravityDirectionAndSpeed.ToUnmanaged(), outpos);
outTriangle = Triangle3D.FromUnmanaged(outtri);
return Vector3D.FromUnmanaged(outpos);
}
示例3: AddBillboardTextSceneNodeW
public TextSceneNode AddBillboardTextSceneNodeW(GUIFont font, string text, SceneNode parent, Dimension2Df size, Vector3D position, int id, Color shade_top, Color shade_down)
{
IntPtr par = IntPtr.Zero;
if (parent != null)
par = parent.Raw;
return (TextSceneNode)
NativeElement.GetObject(SceneManager_AddTextSceneNode2W(_raw, font.Raw, text, par, size.ToUnmanaged(), position.ToUnmanaged(),
id, shade_top.ToUnmanaged(), shade_down.ToUnmanaged()),
typeof(TextSceneNode));
}
示例4: CreateRotationAnimator
/// <summary>
/// Creates a simple animator that will rotate.
/// </summary>
/// <returns>An Animator</returns>
/// <param name="rotation">Rotation</param>
public Animator CreateRotationAnimator(Vector3D rotation)
{
return (Animator)
NativeElement.GetObject(SceneManager_CreateRotationAnimator(_raw, rotation.ToUnmanaged()),
typeof(Animator));
}
示例5: CreateFlyStraightAnimator
/// <summary>
/// Creates an animator that will fly from one point to... another one !
/// </summary>
/// <returns>An Animator</returns>
/// <param name="start">Start</param>
/// <param name="end">End</param>
/// <param name="time">Time needed</param>
/// <param name="loop">May the movement be looped ?</param>
public Animator CreateFlyStraightAnimator(Vector3D start, Vector3D end, uint time, bool loop)
{
return (Animator)
NativeElement.GetObject(SceneManager_CreateFlyStraightAnimator(_raw, start.ToUnmanaged(), end.ToUnmanaged(), time, loop),
typeof(Animator));
}
示例6: CreateFlyCircleAnimator
/// <summary>
/// Creates an animator that will fly around a center
/// </summary>
/// <returns>An Animator</returns>
/// <param name="center">Center</param>
/// <param name="radius">Radius</param>
/// <param name="speed">Speed</param>
public Animator CreateFlyCircleAnimator(Vector3D center, float radius, float speed)
{
return (Animator)
NativeElement.GetObject(SceneManager_CreateFlyCircleAnimator(_raw, center.ToUnmanaged(), radius, speed),
typeof(Animator));
}
示例7: CreateCollisionResponseAnimator
/// <summary>
/// Creates a simple animator for collision detection
/// </summary>
/// <returns>An Animator</returns>
/// <param name="world">"World", meaning the triangle selector of the terrain/map</param>
/// <param name="node">Node. Notice that this node MUST BE THE ONE THE ANIMATOR IS ADDED</param>
/// <param name="ellipsoidRadius">Ellipsoid radius. Usually it's the difference between the node's skybox's max edge and its center</param>
/// <param name="gravityPerSecond">How much gravity (don't try (0, -100000, 0), even on Jupiter you wouldn't have such gravity)</param>
/// <param name="ellipsoidTranslation">By default (0, 0, 0), meaning the center of the scene node. You can modify it if needed</param>
/// <param name="slidingValue">Sliding value, usually 0.0005f</param>
public Animator CreateCollisionResponseAnimator(TriangleSelector world, SceneNode node, Vector3D ellipsoidRadius, Vector3D gravityPerSecond, Vector3D ellipsoidTranslation, float slidingValue)
{
return (Animator)
NativeElement.GetObject(SceneManager_CreateCollisionResponseAnimator(_raw, world.Raw, node.Raw, ellipsoidRadius.ToUnmanaged(), gravityPerSecond.ToUnmanaged(), ellipsoidTranslation.ToUnmanaged(), slidingValue),
typeof(Animator));
}
示例8: AddTreeSceneNode
public SceneNode AddTreeSceneNode(string XMLString, SceneNode parent, int id, Vector3D position,
Vector3D rotation, Vector3D scale, Texture TreeTexture, Texture LeafTexture, Texture BillTexture)
{
IntPtr par = IntPtr.Zero;
if (parent != null)
par = parent.Raw;
return (SceneNode)
NativeElement.GetObject(SceneManager_AddTreeSceneNode(_raw, XMLString, par, id, position.ToUnmanaged(), rotation.ToUnmanaged(), scale.ToUnmanaged(), TreeTexture.Raw, LeafTexture.Raw, BillTexture.Raw, (int)MaterialType.TransparentAlphaChannel), typeof(SceneNode));
}
示例9: AddTerrainSceneNodeFromRawData
public TerrainSceneNode AddTerrainSceneNodeFromRawData(float[,] data, int width, SceneNode parent, int id, Vector3D position, Vector3D rotation, Vector3D scale, Color vertexColor, int maxLOD, TerrainPatchSize patchSize, int smoothFactor)
{
IntPtr par = IntPtr.Zero;
if (parent != null)
par = parent.Raw;
return (TerrainSceneNode)
NativeElement.GetObject(SceneManager_AddTerrainSceneNodeFromRawData(_raw, data, data.Length, width, par, id, position.ToUnmanaged(), rotation.ToUnmanaged(), scale.ToUnmanaged(), vertexColor.ToUnmanaged(), maxLOD, patchSize, smoothFactor),
typeof(TerrainSceneNode));
}
示例10: AddTerrainSceneNode
/// <summary>
/// Adds a heightmap-based terrain on the scene
/// </summary>
/// <returns>The terrain node</returns>
/// <param name="heightMap">Relative or non-relative path to the heightmap.</param>
/// <param name="parent">Parent from the terrain</param>
/// <param name="id">ID (-1 for automatic assign.)</param>
/// <param name="position">Position of the node</param>
/// <param name="rotation">Rotation of the node</param>
/// <param name="scale">Scale of the node</param>
/// <param name="vertexColor">Default color of all the vertices used if no texture is assigned to the node.</param>
/// <param name="maxLOD">Maximal LOD, set 5 or change it ONLY IF YOU KNOW WHAT YOU ARE DOING</param>
/// <param name="patchSize">PatchSize, should be 17 and you mustn't change it unless you know what you're doing</param>
public TerrainSceneNode AddTerrainSceneNode(string heightMap, SceneNode parent, int id, Vector3D position, Vector3D rotation, Vector3D scale, Color vertexColor, int maxLOD, TerrainPatchSize patchSize, int smoothFactor)
{
IntPtr par = IntPtr.Zero;
if(parent != null)
par = parent.Raw;
return (TerrainSceneNode)
NativeElement.GetObject(SceneManager_AddTerrainSceneNode(_raw, heightMap, par, id, position.ToUnmanaged(), rotation.ToUnmanaged(), scale.ToUnmanaged(), vertexColor.ToUnmanaged(), maxLOD, patchSize, smoothFactor),
typeof(TerrainSceneNode));
}
示例11: AddLightSceneNode
/// <summary>
/// Adds a light scene node to the scene
/// </summary>
/// <returns>The light</returns>
/// <param name="parent">Parent from the node</param>
/// <param name="position">Initial position of the light</param>
/// <param name="color">Floating color of the light</param>
/// <param name="radius">Radius of the light</param>
/// <param name="id">ID (-1 for automatic assignation)</param>
public LightSceneNode AddLightSceneNode(SceneNode parent, Vector3D position, Colorf color, float radius, int id)
{
IntPtr par = IntPtr.Zero;
if(parent != null)
par = parent.Raw;
return (LightSceneNode)
NativeElement.GetObject(SceneManager_AddLightSceneNode(_raw, par, position.ToUnmanaged(), color.ToUnmanaged(), radius, id),
typeof(LightSceneNode));
}
示例12: Draw3DLine
public void Draw3DLine(Vector3D start, Vector3D end, Color color)
{
VideoDriver_Draw3DLine(_raw, start.ToUnmanaged(), end.ToUnmanaged(), color.ToUnmanaged());
}
示例13: CreatePointEmitter
public ParticleEmitter CreatePointEmitter(Vector3D direction, uint minPPS, uint maxPPS, Color minSC, Color maxSC, uint minLT, uint maxLT, int maxAngleDegrees)
{
return (ParticleEmitter)
NativeElement.GetObject(Particle_CreatePointEmitter(_raw, direction.ToUnmanaged(), minPPS, maxPPS, minSC.ToUnmanaged(), maxSC.ToUnmanaged(), minLT, maxLT, maxAngleDegrees),
typeof(ParticleEmitter));
}
示例14: CreateGravityAffector
public ParticleAffector CreateGravityAffector(Vector3D gravity, uint timeForceLost)
{
return (ParticleAffector)
NativeElement.GetObject(Particle_CreateGravityAffector(_raw, gravity.ToUnmanaged(), timeForceLost),
typeof(ParticleAffector));
}
示例15: ScaleMesh
/// <summary>
/// Scales the whole mesh.
/// </summary>
/// <param name="mesh">Mesh on which the operation is performed. </param>
/// <param name="scale">Scale factor. </param>
public void ScaleMesh(Mesh mesh, Vector3D scale)
{
MeshManipulator_ScaleMesh(_raw, mesh.Raw, scale.ToUnmanaged());
}