Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
arcball.c File Reference
#include <glcomp/glcompdefs.h>
#include "smyrnadefs.h"
#include "arcball.h"
Include dependency graph for arcball.c:

Go to the source code of this file.

Macros

#define ARCBALL_C
 

Functions

static void setBounds (ArcBall_t *a, float NewWidth, float NewHeight)
 
static void mapToSphere (ArcBall_t *a, const Point2fT *NewPt, Vector3fT *NewVec)
 
void init_arcBall (ArcBall_t *a, float NewWidth, float NewHeight)
 
static void click (ArcBall_t *a, const Point2fT *NewPt)
 
static void drag (ArcBall_t *a, const Point2fT *NewPt, Quat4fT *NewRot)
 
void arcmouseClick (void)
 
void arcmouseDrag (void)
 

Variables

static Matrix4fT Transform
 
static Matrix3fT LastRot
 
static Matrix3fT ThisRot
 

Macro Definition Documentation

◆ ARCBALL_C

#define ARCBALL_C

Copyright (c) 1999-2009 Tatewake.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Definition at line 26 of file arcball.c.

Function Documentation

◆ arcmouseClick()

void arcmouseClick ( void  )

Definition at line 142 of file arcball.c.

References _ViewInfo::arcball, click(), _ArcBall_t::isDragging, _ArcBall_t::LastRot, _ArcBall_t::MousePt, _ArcBall_t::ThisRot, and view.

Referenced by apply_actions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ arcmouseDrag()

void arcmouseDrag ( void  )

Definition at line 150 of file arcball.c.

References _ViewInfo::arcball, drag(), _ArcBall_t::LastRot, _ArcBall_t::MousePt, Quat4fT, _ArcBall_t::ThisRot, _ArcBall_t::Transform, and view.

Referenced by apply_actions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ click()

static void click ( ArcBall_t a,
const Point2fT NewPt 
)
static

Definition at line 106 of file arcball.c.

References mapToSphere(), and _ArcBall_t::StVec.

Referenced by arcmouseClick().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drag()

static void drag ( ArcBall_t a,
const Point2fT NewPt,
Quat4fT NewRot 
)
static

Definition at line 113 of file arcball.c.

References _ArcBall_t::EnVec, Epsilon, mapToSphere(), _ArcBall_t::StVec, and Vector3fT.

Referenced by arcmouseDrag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_arcBall()

void init_arcBall ( ArcBall_t a,
float  NewWidth,
float  NewHeight 
)

Definition at line 88 of file arcball.c.

References _ArcBall_t::EnVec, _ArcBall_t::isClicked, _ArcBall_t::isDragging, _ArcBall_t::isRClicked, LastRot, _ArcBall_t::LastRot, setBounds(), _ArcBall_t::StVec, ThisRot, _ArcBall_t::ThisRot, Transform, and _ArcBall_t::Transform.

Referenced by cb_reshape(), and configure_event().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mapToSphere()

static void mapToSphere ( ArcBall_t a,
const Point2fT NewPt,
Vector3fT NewVec 
)
static

Definition at line 37 of file arcball.c.

References _ArcBall_t::AdjustHeight, _ArcBall_t::AdjustWidth, FuncSqrt, norm(), and Point2fT.

Referenced by click(), and drag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBounds()

static void setBounds ( ArcBall_t a,
float  NewWidth,
float  NewHeight 
)
static

Definition at line 30 of file arcball.c.

References _ArcBall_t::AdjustHeight, and _ArcBall_t::AdjustWidth.

Referenced by init_arcBall().

Here is the caller graph for this function:

Variable Documentation

◆ LastRot

Matrix3fT LastRot
static
Initial value:
= { {1.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 1.0f}
}

Definition at line 77 of file arcball.c.

Referenced by init_arcBall().

◆ ThisRot

Matrix3fT ThisRot
static
Initial value:
= { {1.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 1.0f}
}

Definition at line 82 of file arcball.c.

Referenced by init_arcBall().

◆ Transform

Matrix4fT Transform
static
Initial value:
= { {1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f}
}

Definition at line 71 of file arcball.c.

Referenced by init_arcBall().