vector element

This commit is contained in:
ikpil 2023-03-28 23:08:24 +09:00
parent dbed85ab17
commit f97242faea
2 changed files with 7 additions and 11 deletions

View File

@ -17,15 +17,14 @@ freely, subject to the following restrictions:
*/ */
using System; using System;
using System.Numerics;
namespace DotRecast.Core namespace DotRecast.Core
{ {
public struct Vector3f public struct Vector3f
{ {
public float x { get; set; } public float x;
public float y { get; set; } public float y;
public float z { get; set; } public float z;
public Vector3f(float x, float y, float z) public Vector3f(float x, float y, float z)
{ {

View File

@ -29,8 +29,7 @@ namespace DotRecast.Recast
RecastConfig cfg = builderCfg.cfg; RecastConfig cfg = builderCfg.cfg;
// Allocate voxel heightfield where we rasterize our input data to. // Allocate voxel heightfield where we rasterize our input data to.
Heightfield solid = new Heightfield(builderCfg.width, builderCfg.height, builderCfg.bmin, builderCfg.bmax, cfg.cs, Heightfield solid = new Heightfield(builderCfg.width, builderCfg.height, builderCfg.bmin, builderCfg.bmax, cfg.cs, cfg.ch, cfg.borderSize);
cfg.ch, cfg.borderSize);
// Allocate array that can hold triangle area types. // Allocate array that can hold triangle area types.
// If you have multiple meshes you need to process, allocate // If you have multiple meshes you need to process, allocate
@ -58,8 +57,7 @@ namespace DotRecast.Recast
{ {
int[] tris = node.tris; int[] tris = node.tris;
int ntris = tris.Length / 3; int ntris = tris.Length / 3;
int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris, int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris, cfg.walkableAreaMod);
cfg.walkableAreaMod);
RecastRasterization.rasterizeTriangles(solid, verts, tris, m_triareas, ntris, cfg.walkableClimb, ctx); RecastRasterization.rasterizeTriangles(solid, verts, tris, m_triareas, ntris, cfg.walkableClimb, ctx);
} }
} }
@ -67,8 +65,7 @@ namespace DotRecast.Recast
{ {
int[] tris = geom.getTris(); int[] tris = geom.getTris();
int ntris = tris.Length / 3; int ntris = tris.Length / 3;
int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris, int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris, cfg.walkableAreaMod);
cfg.walkableAreaMod);
RecastRasterization.rasterizeTriangles(solid, verts, tris, m_triareas, ntris, cfg.walkableClimb, ctx); RecastRasterization.rasterizeTriangles(solid, verts, tris, m_triareas, ntris, cfg.walkableClimb, ctx);
} }
} }