Skip to content

Commit

Permalink
h3d Polygon: >65k indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
SpiraTom committed Jan 5, 2021
1 parent 05a96f3 commit 4aaf4e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions h3d/col/Polygon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ class Polygon implements Collider {
public function new() {
}

public function addBuffers( vertexes : haxe.ds.Vector<hxd.impl.Float32>, indexes : haxe.ds.Vector<hxd.impl.UInt16>, stride = 3 ) {
public function addBuffers( vertexes : haxe.ds.Vector<hxd.impl.Float32>, indexes : haxe.ds.Vector<Int>, stride = 3 ) {
for(i in 0...Std.int(indexes.length / 3)) {
var k = i * 3;

var t = new TriPlane();

var i0 = (indexes[k]:Int) * stride;
var i1 = (indexes[k + 1]:Int) * stride;
var i2 = (indexes[k + 2]:Int) * stride;
var i0 = indexes[k] * stride;
var i1 = indexes[k + 1] * stride;
var i2 = indexes[k + 2] * stride;

t.init(
new Point(vertexes[i0], vertexes[i0 + 1], vertexes[i0 + 2]),
Expand Down
2 changes: 1 addition & 1 deletion h3d/prim/Polygon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class Polygon extends MeshPrimitive {

override function getCollider() : h3d.col.Collider {
var vertexes = new haxe.ds.Vector<hxd.impl.Float32>(points.length * 3);
var indexes = new haxe.ds.Vector<hxd.impl.UInt16>(idx.length);
var indexes = new haxe.ds.Vector<Int>(idx.length);
var vid = 0;
for( p in points ) {
vertexes[vid++] = p.x;
Expand Down

0 comments on commit 4aaf4e6

Please sign in to comment.