You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rfcs/12-primitive-shapes.md
+18-23Lines changed: 18 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,6 @@ The complete overview of shapes, their dimensions and their names can be seen in
85
85
| Circle | Circle | - | A circle defined by its radius |
86
86
| Polygon | Polygon | - | A closed shape in a plane defined by a finite number of line-segments between vertices |
87
87
| RegularPolygon | RegularPolygon | - | A polygon where all vertices lies on the circumscribed circle, equally far apart |
88
-
| Point | Point2d | Point3d | A single point in space |
89
88
| Plane | Plane2d | Plane3d | An unbounded plane defined by a position and normal |
90
89
| Direction | Direction2d | Direction3d | A normalized vector pointing in a direction |
91
90
| Ray | Ray2d | Ray3d | An infinite half-line pointing in a direction |
@@ -144,45 +143,43 @@ trait Collider3d {
144
143
### 2D Geometry Types
145
144
146
145
```rust
147
-
structPoint2d(Vec2)
148
-
149
146
structDirection2d(Vec2)
150
147
implMeshableforDirection2d {}
151
148
152
149
structRay2d {
153
-
point:Point2d,
150
+
point:Vec2,
154
151
direction:Direction2d
155
152
}
156
153
implMeshableforRay2d {}
157
154
158
155
structLine2d {
159
-
point:Point2d,
156
+
point:Vec2,
160
157
direction:Direction2d,
161
158
}
162
159
implMeshableforLine2d {}
163
160
164
161
/// A finite line between two vertices
165
162
structLineSegment2d {
166
-
start:Point2d,
167
-
end:Point2d,
163
+
start:Vec2,
164
+
end:Vec2,
168
165
}
169
166
implMeshableforLineSegment2d {}
170
167
171
168
/// A line drawn along a path of vertices
172
169
structPolyLine2d<constN:usize>{
173
-
points: [Point2d; N],
170
+
points: [Vec2; N],
174
171
}
175
172
implMeshableforPolyLine2d {}
176
173
177
-
structTriangle2d([Point2d; 3]);
174
+
structTriangle2d([Vec2; 3]);
178
175
implMeshableforTriangle2d {}
179
176
180
-
structQuad2d([Point2d; 4]);
177
+
structQuad2d([Vec2; 4]);
181
178
implMeshableforQuad2d {}
182
179
183
180
/// A closed shape in a plane defined by a finite number of line-segments between vertices
184
181
structPolygon2d <constN:usize>{
185
-
points: [Point2d; N],
182
+
points: [Vec2; N],
186
183
}
187
184
implMeshableforPolygon2d {}
188
185
@@ -273,21 +270,19 @@ impl Collider2d for CapsuleCollider2d {}
273
270
### 3D Geometry Types
274
271
275
272
```rust
276
-
structPoint3d(Vec3)
277
-
278
273
/// Vector direction in 3D space that is guaranteed to be normalized through its getter/setter.
279
274
structDirection3d(Vec3)
280
275
implMeshableforDirection3d {}
281
276
282
277
structPlane3d {
283
-
point:Point3d,
278
+
point:Vec3,
284
279
normal:Direction3d,
285
280
}
286
281
implMeshableforPlane3d {}
287
282
288
283
/// Differentiates a line from a ray, where a line is infinite and a ray is directional half-line, although their underlying representation is the same.
289
284
structRay3d(
290
-
point:Point3d,
285
+
point:Vec3,
291
286
direction:Direction3d,
292
287
);
293
288
implMeshableforRay3d {}
@@ -296,29 +291,29 @@ impl Meshable for Ray3d {}
296
291
297
292
/// Unbounded line in 3D space with directionality
298
293
structLine3d {
299
-
point:Point3d,
294
+
point:Vec3,
300
295
direction:Direction3d,
301
296
}
302
297
implMeshableforLine3d {}
303
298
304
299
/// A line segment bounded by two points
305
300
structLineSegment3d {
306
-
start:Point3d,
307
-
end:Point3d,
301
+
start:Vec3,
302
+
end:Vec3,
308
303
}
309
304
implMeshableforLineSegment3d {}
310
305
311
306
/// A line drawn along a path of points
312
307
structPolyLine3d {
313
-
points:Vec<Point3d>,
308
+
points:Vec<Vec3>,
314
309
}
315
310
implMeshableforPolyLine3d {}
316
311
317
-
structTriangle3d([Point3d; 3]);
312
+
structTriangle3d([Vec3; 3]);
318
313
implMeshableforTriangle3d {}
319
314
implColliderforTriangle3d {}
320
315
321
-
structQuad3d([Point3d; 4]);
316
+
structQuad3d([Vec3; 4]);
322
317
implMeshableforQuad3d {}
323
318
implColliderforQuad3d {}
324
319
@@ -500,7 +495,7 @@ The bounding volumes sections of this RFC cover how these types could be used fo
0 commit comments