fix(rendering): selection box around models
This commit is contained in:
parent
525a9155e4
commit
e51ed0c7c5
2 changed files with 5 additions and 5 deletions
|
@ -23,6 +23,7 @@ public:
|
|||
inline CFrame assemblyOrigin() { return _assemblyOrigin; };
|
||||
inline Vector3 bounds() { return _bounds; };
|
||||
inline Vector3 size() { return _size; };
|
||||
inline bool multipleSelected() { return parts.size() > 1; }
|
||||
|
||||
// Transforms the assembly such that newOrigin is now this assembly's new assemblyOrigin
|
||||
void SetOrigin(CFrame newOrigin);
|
||||
|
|
|
@ -475,11 +475,10 @@ void renderOutlines() {
|
|||
}
|
||||
|
||||
// Render AABB of selected parts
|
||||
if (count <= 1) return;
|
||||
|
||||
glm::vec3 outlineSize, outlinePos;
|
||||
outlineSize = (max - min);
|
||||
outlinePos = (max + min) / 2.f;
|
||||
PartAssembly selectionAssembly = PartAssembly::FromSelection();
|
||||
if (!selectionAssembly.multipleSelected()) return;
|
||||
glm::vec3 outlineSize = selectionAssembly.bounds();
|
||||
glm::vec3 outlinePos = selectionAssembly.assemblyOrigin().Position();
|
||||
|
||||
glm::mat4 model = glm::translate(glm::mat4(1.0f), outlinePos);
|
||||
model = glm::scale(model, outlineSize + glm::vec3(0.1));
|
||||
|
|
Loading…
Add table
Reference in a new issue