@@ -18,14 +18,20 @@ class Vertex {
1818 required Vector2 texCoord,
1919 this .color = const Color (0xFFFFFFFF ),
2020 Vector3 ? normal,
21+ Vector4 ? joints,
22+ Vector4 ? weights,
2123 }) : position = position.immutable,
2224 texCoord = texCoord.immutable,
2325 normal = normal? .immutable,
26+ joints = joints? .immutable,
27+ weights = weights? .immutable,
2428 _storage = Float32List .fromList ([
2529 ...position.storage, // 1, 2, 3
2630 ...texCoord.storage, // 4, 5
2731 ...color.storage, // 6, 7, 8, 9
2832 ...(normal ?? Vector3 .zero ()).storage, // 10, 11, 12
33+ ...(joints ?? Vector4 .zero ()).storage, // 13, 14, 15, 16
34+ ...(weights ?? Vector4 .zero ()).storage, // 17, 18, 19, 20
2935 ]);
3036
3137 Float32List get storage => _storage;
@@ -40,6 +46,12 @@ class Vertex {
4046 /// The normal vector of the vertex.
4147 final ImmutableVector3 ? normal;
4248
49+ /// The joints of the vertex.
50+ final ImmutableVector4 ? joints;
51+
52+ /// The weights of the vertex.
53+ final ImmutableVector4 ? weights;
54+
4355 /// The color on the vertex.
4456 final Color color;
4557
@@ -49,23 +61,36 @@ class Vertex {
4961 position == other.position &&
5062 texCoord == other.texCoord &&
5163 normal == other.normal &&
52- color == other.color;
64+ color == other.color &&
65+ joints == other.joints &&
66+ weights == other.weights;
5367
5468 @override
55- int get hashCode => Object .hashAll ([position, texCoord, normal, color]);
69+ int get hashCode => Object .hashAll ([
70+ position,
71+ texCoord,
72+ normal,
73+ color,
74+ joints,
75+ weights,
76+ ]);
5677
5778 Vertex copyWith ({
5879 Vector3 ? position,
5980 Vector2 ? texCoord,
6081 Vector3 ? normal,
6182 Color ? color,
83+ Vector4 ? joints,
84+ Vector4 ? weights,
6285 }) {
6386 // TODO(wolfenrain): optimize this.
6487 return Vertex (
6588 position: position ?? this .position.mutable,
6689 texCoord: texCoord ?? this .texCoord.mutable,
6790 normal: normal ?? this .normal? .mutable,
6891 color: color ?? this .color,
92+ joints: joints ?? this .joints? .mutable,
93+ weights: weights ?? this .weights? .mutable,
6994 );
7095 }
7196
0 commit comments