forked from bit/DotRecastNetSim
vector element
This commit is contained in:
parent
dbed85ab17
commit
f97242faea
|
@ -17,15 +17,14 @@ freely, subject to the following restrictions:
|
|||
*/
|
||||
|
||||
using System;
|
||||
using System.Numerics;
|
||||
|
||||
namespace DotRecast.Core
|
||||
{
|
||||
public struct Vector3f
|
||||
{
|
||||
public float x { get; set; }
|
||||
public float y { get; set; }
|
||||
public float z { get; set; }
|
||||
public float x;
|
||||
public float y;
|
||||
public float z;
|
||||
|
||||
public Vector3f(float x, float y, float z)
|
||||
{
|
||||
|
@ -64,7 +63,7 @@ namespace DotRecast.Core
|
|||
case 2:
|
||||
z = value;
|
||||
break;
|
||||
|
||||
|
||||
default: throw new IndexOutOfRangeException($"{index}-{value}");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,8 +29,7 @@ namespace DotRecast.Recast
|
|||
RecastConfig cfg = builderCfg.cfg;
|
||||
|
||||
// Allocate voxel heightfield where we rasterize our input data to.
|
||||
Heightfield solid = new Heightfield(builderCfg.width, builderCfg.height, builderCfg.bmin, builderCfg.bmax, cfg.cs,
|
||||
cfg.ch, cfg.borderSize);
|
||||
Heightfield solid = new Heightfield(builderCfg.width, builderCfg.height, builderCfg.bmin, builderCfg.bmax, cfg.cs, cfg.ch, cfg.borderSize);
|
||||
|
||||
// Allocate array that can hold triangle area types.
|
||||
// If you have multiple meshes you need to process, allocate
|
||||
|
@ -58,8 +57,7 @@ namespace DotRecast.Recast
|
|||
{
|
||||
int[] tris = node.tris;
|
||||
int ntris = tris.Length / 3;
|
||||
int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris,
|
||||
cfg.walkableAreaMod);
|
||||
int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris, cfg.walkableAreaMod);
|
||||
RecastRasterization.rasterizeTriangles(solid, verts, tris, m_triareas, ntris, cfg.walkableClimb, ctx);
|
||||
}
|
||||
}
|
||||
|
@ -67,8 +65,7 @@ namespace DotRecast.Recast
|
|||
{
|
||||
int[] tris = geom.getTris();
|
||||
int ntris = tris.Length / 3;
|
||||
int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris,
|
||||
cfg.walkableAreaMod);
|
||||
int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris, cfg.walkableAreaMod);
|
||||
RecastRasterization.rasterizeTriangles(solid, verts, tris, m_triareas, ntris, cfg.walkableClimb, ctx);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue