Skip to content

Commit 3671749

Browse files
author
Raymond Hulha
committed
made Vector not allocate a Float32List when Vector.useList is used.
1 parent 4ed5fd6 commit 3671749

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/src/vector.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ part of chronos_gl;
22

33
class Vector {
44

5-
Float32List array = new Float32List(3);
5+
Float32List array;
66

77
double get x => array[0];
88
double get y => array[1];
@@ -16,13 +16,15 @@ class Vector {
1616
Vector.useList( this.array);
1717

1818
Vector.fromList( Float32List array) {
19+
this.array = new Float32List(3);
1920
this.array[0] = array[0];
2021
this.array[1] = array[1];
2122
this.array[2] = array[2];
2223
}
2324

2425
Vector( [double x=0.0, double y=0.0, double z=0.0])
2526
{
27+
array = new Float32List(3);
2628
array[0] = x;
2729
array[1] = y;
2830
array[2] = z;

0 commit comments

Comments
 (0)