3D transform gizmo (Three.js TransformControls + ImGuizmo style). Owns TRS + optional local bounds; interaction via world-space rays. Host renders using getPart* descriptors — no GPU dependency. 更多...
#include <TransformGizmo.h>
Public 成员函数 | |
| TransformGizmo () | |
| Transform gizmo. | |
| void | setMode (const std::string &mode) |
| Sets the mode. | |
| std::string | getMode () const |
| Returns the mode. | |
| void | setSpace (const std::string &space) |
| Sets the space. | |
| std::string | getSpace () const |
| Returns the space. | |
| void | setSize (float size) |
| Sets the size. | |
| float | getSize () const |
| Returns the size. | |
| void | setPosition (float x, float y, float z) |
| Sets the position. | |
| float | getPositionX () const |
| Returns the position x. | |
| float | getPositionY () const |
| Returns the position y. | |
| float | getPositionZ () const |
| Returns the position z. | |
| void | setRotationEuler (float x, float y, float z) |
| Euler radians, XYZ order. | |
| float | getRotationX () const |
| Returns the rotation x. | |
| float | getRotationY () const |
| Returns the rotation y. | |
| float | getRotationZ () const |
| Returns the rotation z. | |
| void | setScale (float x, float y, float z) |
| Sets the scale. | |
| float | getScaleX () const |
| Returns the scale x. | |
| float | getScaleY () const |
| Returns the scale y. | |
| float | getScaleZ () const |
| Returns the scale z. | |
| void | setBounds (float minX, float minY, float minZ, float maxX, float maxY, float maxZ) |
| Local AABB extents for bound mode (relative to object origin). | |
| float | getBoundsMinX () const |
| Returns the bounds min x. | |
| float | getBoundsMinY () const |
| Returns the bounds min y. | |
| float | getBoundsMinZ () const |
| Returns the bounds min z. | |
| float | getBoundsMaxX () const |
| Returns the bounds max x. | |
| float | getBoundsMaxY () const |
| Returns the bounds max y. | |
| float | getBoundsMaxZ () const |
| Returns the bounds max z. | |
| void | setSnapTranslate (float x, float y, float z) |
| Sets the snap translate. | |
| void | setSnapRotate (float degrees) |
| Sets the snap rotate. | |
| void | setSnapScale (float s) |
| Sets the snap scale. | |
| float | getSnapTranslateX () const |
| Returns the snap translate x. | |
| float | getSnapTranslateY () const |
| Returns the snap translate y. | |
| float | getSnapTranslateZ () const |
| Returns the snap translate z. | |
| float | getSnapRotate () const |
| Returns the snap rotate. | |
| float | getSnapScale () const |
| Returns the snap scale. | |
| float | getMatrix (int index) const |
| Column-major matrix element 0..15 of current TRS. | |
| std::string | pick (float ox, float oy, float oz, float dx, float dy, float dz) |
| Ray pick against active mode handles. Returns axis id: "x"|"y"|"z"|"xy"|"yz"|"xz"|"xyz"|"bx"|…|"bz"|"" . | |
| bool | beginDrag (const std::string &axis, float ox, float oy, float oz, float dx, float dy, float dz) |
| Begins drag. | |
| bool | updateDrag (float ox, float oy, float oz, float dx, float dy, float dz) |
| Updates drag. | |
| void | endDrag () |
| Ends drag. | |
| bool | isDragging () const |
| True when dragging. | |
| bool | isHovered () const |
| True when hovered. | |
| std::string | getActiveAxis () const |
| Returns the active axis. | |
| std::string | getHoverAxis () const |
| Returns the hover axis. | |
| void | rebuildParts () |
| Rebuild draw parts for current mode/space (call after TRS/mode change). | |
| int | getPartCount () const |
| Returns the part count. | |
| std::string | getPartKind (int index) const |
| Returns the part kind. | |
| std::string | getPartAxis (int index) const |
| Returns the part axis. | |
| float | getPartColorR (int index) const |
| Returns the part color r. | |
| float | getPartColorG (int index) const |
| Returns the part color g. | |
| float | getPartColorB (int index) const |
| Returns the part color b. | |
| float | getPartColorA (int index) const |
| Returns the part color a. | |
| float | getPartOriginX (int index) const |
| Returns the part origin x. | |
| float | getPartOriginY (int index) const |
| Returns the part origin y. | |
| float | getPartOriginZ (int index) const |
| Returns the part origin z. | |
| float | getPartDirX (int index) const |
| Returns the part dir x. | |
| float | getPartDirY (int index) const |
| Returns the part dir y. | |
| float | getPartDirZ (int index) const |
| Returns the part dir z. | |
| float | getPartLength (int index) const |
| Returns the part length. | |
| float | getPartRadius (int index) const |
| Returns the part radius. | |
详细描述
3D transform gizmo (Three.js TransformControls + ImGuizmo style). Owns TRS + optional local bounds; interaction via world-space rays. Host renders using getPart* descriptors — no GPU dependency.
在文件 TransformGizmo.h 第 18 行定义.
构造及析构函数说明
◆ TransformGizmo()
| eve::editor::TransformGizmo::TransformGizmo | ( | ) |
成员函数说明
◆ beginDrag()
| bool eve::editor::TransformGizmo::beginDrag | ( | const std::string & | axis, |
| float | ox, | ||
| float | oy, | ||
| float | oz, | ||
| float | dx, | ||
| float | dy, | ||
| float | dz | ||
| ) |
◆ endDrag()
| void eve::editor::TransformGizmo::endDrag | ( | ) |
Ends drag.
在文件 TransformGizmo.cpp 第 571 行定义.
引用了 rebuildParts().
被这些函数引用 eve::editor::GizmoManager::detach() , 以及 eve::editor::GizmoManager::endDrag().
◆ getActiveAxis()
|
inline |
Returns the active axis.
在文件 TransformGizmo.h 第 119 行定义.
◆ getBoundsMaxX()
|
inline |
Returns the bounds max x.
在文件 TransformGizmo.h 第 74 行定义.
◆ getBoundsMaxY()
|
inline |
Returns the bounds max y.
在文件 TransformGizmo.h 第 76 行定义.
◆ getBoundsMaxZ()
|
inline |
Returns the bounds max z.
在文件 TransformGizmo.h 第 78 行定义.
◆ getBoundsMinX()
|
inline |
Returns the bounds min x.
在文件 TransformGizmo.h 第 68 行定义.
◆ getBoundsMinY()
|
inline |
Returns the bounds min y.
在文件 TransformGizmo.h 第 70 行定义.
◆ getBoundsMinZ()
|
inline |
Returns the bounds min z.
在文件 TransformGizmo.h 第 72 行定义.
◆ getHoverAxis()
|
inline |
Returns the hover axis.
在文件 TransformGizmo.h 第 121 行定义.
◆ getMatrix()
| float eve::editor::TransformGizmo::getMatrix | ( | int | index | ) | const |
Column-major matrix element 0..15 of current TRS.
在文件 TransformGizmo.cpp 第 85 行定义.
◆ getMode()
|
inline |
Returns the mode.
在文件 TransformGizmo.h 第 26 行定义.
◆ getPartAxis()
| std::string eve::editor::TransformGizmo::getPartAxis | ( | int | index | ) | const |
◆ getPartColorA()
| float eve::editor::TransformGizmo::getPartColorA | ( | int | index | ) | const |
◆ getPartColorB()
| float eve::editor::TransformGizmo::getPartColorB | ( | int | index | ) | const |
◆ getPartColorG()
| float eve::editor::TransformGizmo::getPartColorG | ( | int | index | ) | const |
◆ getPartColorR()
| float eve::editor::TransformGizmo::getPartColorR | ( | int | index | ) | const |
◆ getPartCount()
|
inline |
Returns the part count.
在文件 TransformGizmo.h 第 127 行定义.
◆ getPartDirX()
| float eve::editor::TransformGizmo::getPartDirX | ( | int | index | ) | const |
◆ getPartDirY()
| float eve::editor::TransformGizmo::getPartDirY | ( | int | index | ) | const |
◆ getPartDirZ()
| float eve::editor::TransformGizmo::getPartDirZ | ( | int | index | ) | const |
◆ getPartKind()
| std::string eve::editor::TransformGizmo::getPartKind | ( | int | index | ) | const |
◆ getPartLength()
| float eve::editor::TransformGizmo::getPartLength | ( | int | index | ) | const |
◆ getPartOriginX()
| float eve::editor::TransformGizmo::getPartOriginX | ( | int | index | ) | const |
◆ getPartOriginY()
| float eve::editor::TransformGizmo::getPartOriginY | ( | int | index | ) | const |
◆ getPartOriginZ()
| float eve::editor::TransformGizmo::getPartOriginZ | ( | int | index | ) | const |
◆ getPartRadius()
| float eve::editor::TransformGizmo::getPartRadius | ( | int | index | ) | const |
◆ getPositionX()
|
inline |
Returns the position x.
在文件 TransformGizmo.h 第 41 行定义.
◆ getPositionY()
|
inline |
Returns the position y.
在文件 TransformGizmo.h 第 43 行定义.
◆ getPositionZ()
|
inline |
Returns the position z.
在文件 TransformGizmo.h 第 45 行定义.
◆ getRotationX()
|
inline |
Returns the rotation x.
在文件 TransformGizmo.h 第 50 行定义.
◆ getRotationY()
|
inline |
Returns the rotation y.
在文件 TransformGizmo.h 第 52 行定义.
◆ getRotationZ()
|
inline |
Returns the rotation z.
在文件 TransformGizmo.h 第 54 行定义.
◆ getScaleX()
|
inline |
Returns the scale x.
在文件 TransformGizmo.h 第 59 行定义.
◆ getScaleY()
|
inline |
Returns the scale y.
在文件 TransformGizmo.h 第 61 行定义.
◆ getScaleZ()
|
inline |
Returns the scale z.
在文件 TransformGizmo.h 第 63 行定义.
◆ getSize()
|
inline |
Returns the size.
在文件 TransformGizmo.h 第 36 行定义.
◆ getSnapRotate()
|
inline |
Returns the snap rotate.
在文件 TransformGizmo.h 第 93 行定义.
◆ getSnapScale()
|
inline |
Returns the snap scale.
在文件 TransformGizmo.h 第 95 行定义.
◆ getSnapTranslateX()
|
inline |
Returns the snap translate x.
在文件 TransformGizmo.h 第 87 行定义.
◆ getSnapTranslateY()
|
inline |
Returns the snap translate y.
在文件 TransformGizmo.h 第 89 行定义.
◆ getSnapTranslateZ()
|
inline |
Returns the snap translate z.
在文件 TransformGizmo.h 第 91 行定义.
◆ getSpace()
|
inline |
Returns the space.
在文件 TransformGizmo.h 第 31 行定义.
◆ isDragging()
|
inline |
True when dragging.
在文件 TransformGizmo.h 第 115 行定义.
◆ isHovered()
|
inline |
True when hovered.
在文件 TransformGizmo.h 第 117 行定义.
◆ pick()
| std::string eve::editor::TransformGizmo::pick | ( | float | ox, |
| float | oy, | ||
| float | oz, | ||
| float | dx, | ||
| float | dy, | ||
| float | dz | ||
| ) |
Ray pick against active mode handles. Returns axis id: "x"|"y"|"z"|"xy"|"yz"|"xz"|"xyz"|"bx"|…|"bz"|"" .
在文件 TransformGizmo.cpp 第 323 行定义.
引用了 b, best, c, dx, dy, dz, ox, oy, rebuildParts(), s, score , 以及 t.
被这些函数引用 eve::editor::GizmoManager::pick().
◆ rebuildParts()
| void eve::editor::TransformGizmo::rebuildParts | ( | ) |
Rebuild draw parts for current mode/space (call after TRS/mode change).
在文件 TransformGizmo.cpp 第 137 行定义.
引用了 c, kind, local, origin , 以及 p.
被这些函数引用 beginDrag(), endDrag(), pick(), setBounds(), setMode(), setPosition(), setRotationEuler(), setScale(), setSize(), setSpace(), TransformGizmo() , 以及 updateDrag().
◆ setBounds()
| void eve::editor::TransformGizmo::setBounds | ( | float | minX, |
| float | minY, | ||
| float | minZ, | ||
| float | maxX, | ||
| float | maxY, | ||
| float | maxZ | ||
| ) |
Local AABB extents for bound mode (relative to object origin).
在文件 TransformGizmo.cpp 第 72 行定义.
引用了 rebuildParts().
◆ setMode()
| void eve::editor::TransformGizmo::setMode | ( | const std::string & | mode | ) |
Sets the mode.
在文件 TransformGizmo.cpp 第 35 行定义.
引用了 rebuildParts().
被这些函数引用 eve::editor::GizmoManager::GizmoManager() , 以及 eve::editor::GizmoManager::pick().
◆ setPosition()
| void eve::editor::TransformGizmo::setPosition | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
◆ setRotationEuler()
| void eve::editor::TransformGizmo::setRotationEuler | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
◆ setScale()
| void eve::editor::TransformGizmo::setScale | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
◆ setSize()
| void eve::editor::TransformGizmo::setSize | ( | float | size | ) |
◆ setSnapRotate()
| void eve::editor::TransformGizmo::setSnapRotate | ( | float | degrees | ) |
◆ setSnapScale()
| void eve::editor::TransformGizmo::setSnapScale | ( | float | s | ) |
◆ setSnapTranslate()
| void eve::editor::TransformGizmo::setSnapTranslate | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
◆ setSpace()
| void eve::editor::TransformGizmo::setSpace | ( | const std::string & | space | ) |
◆ updateDrag()
| bool eve::editor::TransformGizmo::updateDrag | ( | float | ox, |
| float | oy, | ||
| float | oz, | ||
| float | dx, | ||
| float | dy, | ||
| float | dz | ||
| ) |
该类的文档由以下文件生成:
- src/modules/editor/TransformGizmo.h
- src/modules/editor/TransformGizmo.cpp