Documentation
¶
Index ¶
- func AllowAxisFlip(value bool)
- func BeginFrame()
- func ComputeMouseRay(view, projection *float32, mousePosition, rectPosition, rectSize imgui.Vec2, ...)
- func DecomposeMatrixToComponents(matrix, translation, rotation, scale *float32)
- func DrawAxes(view, projection, matrices *float32, matrixCount int32)
- func DrawCubes(view, projection, matrices *float32, matrixCount int32)
- func DrawGrid(view, projection, matrix *float32, gridSize float32)
- func DrawGridCustom(view, projection, matrix *float32, gridSize, majorStep float32, ...)
- func DrawGridCustomColor(view, projection, matrix *float32, gridSize, majorStep float32, ...)
- func Enable(enable bool)
- func GetIDPtr(ptr_id uintptr) imgui.ID
- func GetIDStr(str_id string) imgui.ID
- func GetIDStrStr(str_id_begin, str_id_end string) imgui.ID
- func IsOver() bool
- func IsOverFloatPtr(position *float32, pixelRadius float32) bool
- func IsOverOPERATION(op OPERATION) bool
- func IsUsing() bool
- func IsUsingAny() bool
- func IsUsingViewManipulate() bool
- func IsViewManipulateHovered() bool
- func Manipulate(view, projection *float32, operation OPERATION, mode MODE, matrix *float32) bool
- func ManipulateV(view, projection *float32, operation OPERATION, mode MODE, ...) bool
- func PopID()
- func PushIDInt(int_id int32)
- func PushIDPtr(ptr_id uintptr)
- func PushIDStr(str_id string)
- func PushIDStrStr(str_id_begin, str_id_end string)
- func RecomposeMatrixFromComponents(translation, rotation, scale, matrix *float32)
- func SetAlternativeWindow(window *imgui.Window)
- func SetAxisLimit(value float32)
- func SetAxisMask(x, y, z bool)
- func SetDrawlist()
- func SetDrawlistV(drawlist *imgui.DrawList)
- func SetGizmoSizeClipSpace(value float32)
- func SetID(id int32)
- func SetImGuiContext(ctx *imgui.Context)
- func SetOrthographic(isOrthographic bool)
- func SetPlaneLimit(value float32)
- func SetRect(x, y, width, height float32)
- func ViewManipulateFloat(view *float32, length float32, position, size imgui.Vec2, ...)
- func ViewManipulateFloatPtr(view, projection *float32, operation OPERATION, mode MODE, matrix *float32, ...)
- type COLOR
- type MODE
- type MOVETYPE
- type OPERATION
- type Style
- func (self Style) C() (C.Style, func())
- func (self *Style) CenterCircleSize() float32
- func (self *Style) Colors() [15]imgui.Vec4
- func (self *Style) Destroy()
- func (self *Style) Handle() (result *C.Style, fin func())
- func (self *Style) HatchedAxisLineThickness() float32
- func (self *Style) RotationLineThickness() float32
- func (self *Style) RotationOuterLineThickness() float32
- func (self *Style) ScaleLineCircleSize() float32
- func (self *Style) ScaleLineThickness() float32
- func (self Style) SetCenterCircleSize(v float32)
- func (self Style) SetColors(v *[15]imgui.Vec4)
- func (self Style) SetHatchedAxisLineThickness(v float32)
- func (self Style) SetRotationLineThickness(v float32)
- func (self Style) SetRotationOuterLineThickness(v float32)
- func (self Style) SetScaleLineCircleSize(v float32)
- func (self Style) SetScaleLineThickness(v float32)
- func (self Style) SetTranslationLineArrowSize(v float32)
- func (self Style) SetTranslationLineThickness(v float32)
- func (self *Style) TranslationLineArrowSize() float32
- func (self *Style) TranslationLineThickness() float32
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowAxisFlip ¶
func AllowAxisFlip(value bool)
// Allow axis to flip // When true (default), the guizmo axis flip for better visibility // When false, they always stay along the positive world/local axis
func ComputeMouseRay ¶ added in v1.6.0
func ComputeMouseRay(view, projection *float32, mousePosition, rectPosition, rectSize imgui.Vec2, rayOrigin, rayDirection *float32)
// Compute the world-space mouse picking ray from explicit inputs, without reading ImGui IO. // Useful for tests/headless usage. view and projection are column-major float[16] (same // layout as Manipulate). rayOrigin and rayDirection receive a float[3] each.
func DecomposeMatrixToComponents ¶
func DecomposeMatrixToComponents(matrix, translation, rotation, scale *float32)
// helper functions for manualy editing translation/rotation/scale with an input float // translation, rotation and scale float points to 3 floats each // Angles are in degrees (more suitable for human editing) // example: // float matrixTranslation[3], matrixRotation[3], matrixScale[3]; // ImGuizmo::DecomposeMatrixToComponents(gizmoMatrix.m16, matrixTranslation, matrixRotation, matrixScale); // ImGui::InputFloat3("Tr", matrixTranslation, 3); // ImGui::InputFloat3("Rt", matrixRotation, 3); // ImGui::InputFloat3("Sc", matrixScale, 3); // ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, gizmoMatrix.m16); // // These functions have some numerical stability issues for now. Use with caution.
func DrawAxes ¶ added in v1.6.0
// Render coordinate system axes (red X, green Y and blue Z). Usefull for debug/tests
func DrawCubes ¶
// Render a cube with face color corresponding to face normal. Usefull for debug/tests
func DrawGridCustom ¶ added in v1.6.0
func DrawGridCustom(view, projection, matrix *float32, gridSize, majorStep float32, subdivision uint32)
// Render grid with customizable major line step and amount of segments between major lines. // NOTE(m.wlasiuk) : calling this function with majorStep = 1.0f and subdivision = 1 is equivalent to DrawGrid in terms of the end result but performs more calculations
func DrawGridCustomColor ¶ added in v1.6.0
func DrawGridCustomColor(view, projection, matrix *float32, gridSize, majorStep float32, subdivision, majorCol, minorCol, centerCol uint32)
// Render grid with customizable major line step and amount of segments between major lines and with possibility to set custom colors for major, minor and center lines
func Enable ¶
func Enable(enable bool)
// enable/disable the gizmo. Stay in the state until next call to Enable. // gizmo is rendered with gray half transparent color when disabled
func GetIDStr ¶
calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself
func GetIDStrStr ¶
func IsOver ¶
func IsOver() bool
// return true if mouse cursor is over any gizmo control (axis, plan or screen component)
func IsOverFloatPtr ¶
// from a x,y,z point in space and using Manipulation view/projection matrix, check if mouse is in pixel radius distance of that projected point
func IsOverOPERATION ¶
// return true if the cursor is over the operation's gizmo
func IsUsing ¶
func IsUsing() bool
// return true if mouse IsOver or if the gizmo is in moving state
func IsUsingViewManipulate ¶
func IsUsingViewManipulate() bool
// return true if the view gizmo is in moving state
func IsViewManipulateHovered ¶ added in v1.2.0
func IsViewManipulateHovered() bool
// only check if your mouse is over the view manipulator - no matter whether it's active or not
func Manipulate ¶
func ManipulateV ¶
func ManipulateV(view, projection *float32, operation OPERATION, mode MODE, matrix, deltaMatrix, snap, localBounds, boundsSnap *float32) bool
ManipulateV parameter default value hint: deltaMatrix: NULL snap: NULL localBounds: NULL boundsSnap: NULL
func PushIDStr ¶
func PushIDStr(str_id string)
// ID stack/scopes // Read the FAQ (docs/FAQ.md or http://dearimgui.org/faq) for more details about how ID are handled in dear imgui. // - Those questions are answered and impacted by understanding of the ID stack system: // - "Q: Why is my widget not reacting when I click on it?" // - "Q: How can I have widgets with an empty label?" // - "Q: How can I have multiple widgets with the same label?" // - Short version: ID are hashes of the entire ID stack. If you are creating widgets in a loop you most likely // want to push a unique identifier (e.g. object pointer, loop index) to uniquely differentiate them. // - You can also use the "Label##foobar" syntax within widget label to distinguish them from each others. // - In this header file we use the "label"/"name" terminology to denote a string that will be displayed + used as an ID, // whereas "str_id" denote a string that is only used as an ID and not normally displayed.// push string into the ID stack (will hash string).
func PushIDStrStr ¶
func PushIDStrStr(str_id_begin, str_id_end string)
push string into the ID stack (will hash string).
func RecomposeMatrixFromComponents ¶
func RecomposeMatrixFromComponents(translation, rotation, scale, matrix *float32)
func SetAlternativeWindow ¶
func SetAxisMask ¶
func SetAxisMask(x, y, z bool)
// Set an axis mask to permanently hide a given axis (true -> hidden, false -> shown)
func SetDrawlist ¶
func SetDrawlist()
func SetDrawlistV ¶
// call inside your own window and before Manipulate() in order to draw gizmo to that window. // Or pass a specific ImDrawList to draw to (e.g. ImGui::GetForegroundDrawList()).
SetDrawlistV parameter default value hint: drawlist: nullptr
func SetGizmoSizeClipSpace ¶
func SetGizmoSizeClipSpace(value float32)
func SetImGuiContext ¶
// this is necessary because when imguizmo is compiled into a dll, and imgui into another // globals are not shared between them. // More details at https://stackoverflow.com/questions/19373061/what-happens-to-global-and-static-variables-in-a-shared-library-when-it-is-dynam // expose method to set imgui context
func SetPlaneLimit ¶
func SetPlaneLimit(value float32)
// Configure the limit where planes are hiden
func ViewManipulateFloat ¶
func ViewManipulateFloat(view *float32, length float32, position, size imgui.Vec2, backgroundColor uint32)
// // Please note that this cubeview is patented by Autodesk : https://patents.google.com/patent/US7782319B2/en // It seems to be a defensive patent in the US. I don't think it will bring troubles using it as // other software are using the same mechanics. But just in case, you are now warned! //
Types ¶
type COLOR ¶
type COLOR int32
original name: COLOR
const ( // directionColor[0] DIRECTIONX COLOR = 0 // directionColor[1] DIRECTIONY COLOR = 1 // directionColor[2] DIRECTIONZ COLOR = 2 // planeColor[0] PLANEX COLOR = 3 // planeColor[1] PLANEY COLOR = 4 // planeColor[2] PLANEZ COLOR = 5 // selectionColor SELECTION COLOR = 6 // inactiveColor INACTIVE COLOR = 7 // translationLineColor TRANSLATIONLINE COLOR = 8 SCALELINE COLOR = 9 ROTATIONUSINGBORDER COLOR = 10 ROTATIONUSINGFILL COLOR = 11 HATCHEDAXISLINES COLOR = 12 TEXT COLOR = 13 TEXTSHADOW COLOR = 14 COUNT COLOR = 15 )
type MOVETYPE ¶ added in v1.6.0
type MOVETYPE int32
Handle type used by the translate/rotate/scale gizmos. original name: MOVETYPE
const ( MTNONE MOVETYPE = 0 MTMOVEX MOVETYPE = 1 MTMOVEY MOVETYPE = 2 MTMOVEZ MOVETYPE = 3 MTMOVEYZ MOVETYPE = 4 MTMOVEZX MOVETYPE = 5 MTMOVEXY MOVETYPE = 6 MTMOVESCREEN MOVETYPE = 7 MTROTATEX MOVETYPE = 8 MTROTATEY MOVETYPE = 9 MTROTATEZ MOVETYPE = 10 MTROTATESCREEN MOVETYPE = 11 MTSCALEX MOVETYPE = 12 MTSCALEY MOVETYPE = 13 MTSCALEZ MOVETYPE = 14 MTSCALEXYZ MOVETYPE = 15 )
func GetActiveHandleType ¶ added in v1.6.0
func GetActiveHandleType() MOVETYPE
// Returns which handle is actively being dragged, or MT_NONE.
func GetActiveMoveType ¶ added in v1.6.0
func GetActiveMoveType() MOVETYPE
// Aliases matching the MOVETYPE enum name.
func GetHoveredHandleType ¶ added in v1.6.0
func GetHoveredHandleType() MOVETYPE
// Returns which handle is currently hovered, or MT_NONE.
func GetHoveredMoveType ¶ added in v1.6.0
func GetHoveredMoveType() MOVETYPE
type OPERATION ¶
type OPERATION int32
call it when you want a gizmo Needs view and projection matrices. matrix parameter is the source matrix (where will be gizmo be drawn) and might be transformed by the function. Return deltaMatrix is optional translation is applied in world space original name: OPERATION
const ( TRANSLATEX OPERATION = 1 TRANSLATEY OPERATION = 2 TRANSLATEZ OPERATION = 4 ROTATEX OPERATION = 8 ROTATEY OPERATION = 16 ROTATEZ OPERATION = 32 ROTATESCREEN OPERATION = 64 SCALEX OPERATION = 128 SCALEY OPERATION = 256 SCALEZ OPERATION = 512 BOUNDS OPERATION = 1024 SCALEXU OPERATION = 2048 SCALEYU OPERATION = 4096 SCALEZU OPERATION = 8192 TRANSLATE OPERATION = 7 ROTATE OPERATION = 120 SCALE OPERATION = 896 // universal SCALEU OPERATION = 14336 UNIVERSAL OPERATION = 14463 )
type Style ¶
func NewEmptyStyle ¶ added in v1.2.0
func NewEmptyStyle() *Style
NewEmptyStyle creates Style with its 0 value.
func NewStyleFromC ¶
NewStyleFromC creates Style from its C pointer. SRC ~= *C.Style