29#include <Inventor/SbBasic.h>
31#include <Inventor/errors/SoDebugError.h>
42 SbVec2f(
const float v[2]) { vec[0] = v[0]; vec[1] = v[1]; }
43 SbVec2f(
float x,
float y) { vec[0] = x; vec[1] = y; }
49 SbVec2f &
setValue(
const float v[2]) { vec[0] = v[0]; vec[1] = v[1];
return *
this; }
56 const float *
getValue(
void)
const {
return vec; }
57 void getValue(
float & x,
float & y)
const { x = vec[0]; y = vec[1]; }
62 float dot(
const SbVec2f & v)
const {
return vec[0] * v[0] + vec[1] * v[1]; }
63 SbBool equals(
const SbVec2f & v,
float tolerance)
const;
64 float length(
void)
const;
65 float sqrLength(
void)
const {
return vec[0] * vec[0] + vec[1] * vec[1]; }
66 void negate(
void) { vec[0] = -vec[0]; vec[1] = -vec[1]; }
67 float normalize(
void);
75 void print(
FILE * fp)
const;
91 SbDividerChk(
"operator/(SbVec2f,float)", d);
104 return ((
v1[0] ==
v2[0]) && (
v1[1] ==
v2[1]));
The SbList class is a template container class for lists.
Definition SbList.h:61
Type operator[](const int index) const
Definition SbList.h:186
a vector class for containing two byte integers.
Definition SbVec2b.h:39
The SbVec2d class is a 2 dimensional vector with double precision floating point coordinates.
Definition SbVec2d.h:39
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition SbVec2f.h:39
SbVec2f(const SbVec2i32 &v)
Definition SbVec2f.h:47
SbVec2f(void)
Definition SbVec2f.h:41
SbVec2f & setValue(float x, float y)
Definition SbVec2f.h:50
float sqrLength(void) const
Definition SbVec2f.h:65
void negate(void)
Definition SbVec2f.h:66
const float * getValue(void) const
Definition SbVec2f.h:56
SbVec2f(const SbVec2d &v)
Definition SbVec2f.h:44
void getValue(float &x, float &y) const
Definition SbVec2f.h:57
SbVec2f & setValue(const float v[2])
Definition SbVec2f.h:49
SbVec2f(const SbVec2b &v)
Definition SbVec2f.h:45
SbVec2f(float x, float y)
Definition SbVec2f.h:43
float dot(const SbVec2f &v) const
Definition SbVec2f.h:62
SbVec2f(const SbVec2s &v)
Definition SbVec2f.h:46
SbVec2f(const float v[2])
Definition SbVec2f.h:42
The SbVec2i32 class is a 2 dimensional vector with short integer coordinates.
Definition SbVec2i32.h:41
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition SbVec2s.h:41