-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a center_offset property to both plane primitive and quad primitive #48764
Conversation
Out of curiosity, why not move the plane/quad mesh itself? Or is this for use in particles? |
@Calinou particles exactly :) |
I wonder if this property should be added to all primitive meshes, or just QuadMesh and PlaneMesh. There's a PrimitiveMesh base class after all. |
I have thought about it, but i wasn't sure of the usecase for other meshes. It shouldn't be a problem to add it later, if the name is kept, right? |
I think it's OK to make a property more general in future |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feature looks good to me.
scene/resources/primitive_meshes.h
Outdated
@@ -211,6 +211,7 @@ class PlaneMesh : public PrimitiveMesh { | |||
Size2 size = Size2(2.0, 2.0); | |||
int subdivide_w = 0; | |||
int subdivide_d = 0; | |||
Vector3 center_offset = Vector3(0.0, 0.0, 0.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0, 0, 0
is the default value for Vector3
, so you don't need to assign anything.
scene/resources/primitive_meshes.cpp
Outdated
@@ -258,7 +258,7 @@ PrimitiveMesh::~PrimitiveMesh() { | |||
} | |||
|
|||
/** | |||
CapsuleMesh | |||
CapsuleMesh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If changing this, would be good to make it match others (2 spaces).
scene/resources/primitive_meshes.h
Outdated
@@ -274,6 +278,7 @@ class QuadMesh : public PrimitiveMesh { | |||
|
|||
private: | |||
Size2 size = Size2(1.0, 1.0); | |||
Vector3 center_offset = Vector3(0.0, 0.0, 0.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
Thanks! |
Adds offset to plane and quad meshes, useful for VFX.
Bugsquad edit: 3.x version: #48763