载入中...
搜索中...
未找到
eve::math::Math类 参考

Math module — glm-backed vectors/matrices, noise, bezier, random. Script: math <- eve.Math(); 更多...

#include <Math.h>

类 eve::math::Math 继承关系图:
eve::Module

Public 成员函数

 Module_REG (Math)
 
 Math ()
 
 ~Math () override=default
 
Vec2newVec2 (float x=0.f, float y=0.f)
 
Vec3newVec3 (float x=0.f, float y=0.f, float z=0.f)
 
Mat4newMat4 ()
 
Mat4newMat4Translation (float x, float y, float z)
 
Mat4newMat4Scale (float sx, float sy, float sz)
 
Mat4newMat4RotationZ (float radians)
 
float clamp (float x, float lo, float hi) const
 
float lerp (float a, float b, float t) const
 
float smoothstep (float edge0, float edge1, float x) const
 
float remap (float x, float inMin, float inMax, float outMin, float outMax) const
 
float degToRad (float deg) const
 
float radToDeg (float rad) const
 
float sign (float x) const
 
float fract (float x) const
 
float approach (float current, float target, float maxDelta) const
 
float wrap (float x, float lo, float hi) const
 
float pingPong (float t, float length) const
 
float inverseLerp (float a, float b, float x) const
 Inverse of lerp: t such that lerp(a,b,t) ≈ x.
 
float smootherstep (float edge0, float edge1, float x) const
 
float bias (float t, float b) const
 Schlick bias/gain — shape [0,1] distributions (procgen falloff).
 
float gain (float t, float g) const
 
float ease (float t, const std::string &kind) const
 Easing on [0,1]. kind: "linear"|"inQuad"|"outQuad"|"inOutQuad"|"inCubic"|"outCubic"|"inOutCubic"| "inSine"|"outSine"|"inOutSine"|"inExpo"|"outExpo"|"inOutExpo"
 
float step (float edge, float x) const
 
float quantize (float x, float stepSize) const
 
float snap (float x, float grid) const
 
float length2 (float x, float y) const
 
float length3 (float x, float y, float z) const
 
float distance2 (float x1, float y1, float x2, float y2) const
 
float distance3 (float x1, float y1, float z1, float x2, float y2, float z2) const
 
float dot2 (float x1, float y1, float x2, float y2) const
 
float dot3 (float x1, float y1, float z1, float x2, float y2, float z2) const
 
float cross2 (float x1, float y1, float x2, float y2) const
 
float angle2 (float x, float y) const
 
float angleBetween2 (float x1, float y1, float x2, float y2) const
 
float lerpAngle (float a, float b, float t) const
 
float normalize2X (float x, float y) const
 
float normalize2Y (float x, float y) const
 
float normalize3X (float x, float y, float z) const
 
float normalize3Y (float x, float y, float z) const
 
float normalize3Z (float x, float y, float z) const
 
float rotate2X (float x, float y, float radians) const
 Rotate (x,y) by radians around origin.
 
float rotate2Y (float x, float y, float radians) const
 
float polarX (float radius, float radians) const
 
float polarY (float radius, float radians) const
 
float cartesianRadius (float x, float y) const
 
float cartesianAngle (float x, float y) const
 
bool pointInCircle (float px, float py, float cx, float cy, float radius) const
 
bool pointInRect (float px, float py, float rx, float ry, float rw, float rh) const
 
bool circlesOverlap (float x1, float y1, float r1, float x2, float y2, float r2) const
 
bool rectsOverlap (float x1, float y1, float w1, float h1, float x2, float y2, float w2, float h2) const
 
bool circleRectOverlap (float cx, float cy, float radius, float rx, float ry, float rw, float rh) const
 
bool segmentsIntersect (float ax, float ay, float bx, float by, float cx, float cy, float dx, float dy) const
 True if segments AB and CD intersect (including endpoints).
 
float raycastCircle2 (float ox, float oy, float dx, float dy, float cx, float cy, float radius) const
 Ray vs circle. Hit point = (ox,oy) + t*(dx,dy). Returns t >= 0 on hit, else -1. Direction need not be unit; for a segment use dir = B-A and accept t in [0,1].
 
float raycastRect2 (float ox, float oy, float dx, float dy, float rx, float ry, float rw, float rh) const
 Ray vs axis-aligned rect (x,y,w,h). Returns parametric t >= 0, else -1.
 
float closestPointOnSegment2X (float px, float py, float ax, float ay, float bx, float by) const
 
float closestPointOnSegment2Y (float px, float py, float ax, float ay, float bx, float by) const
 
bool pointInSphere (float px, float py, float pz, float cx, float cy, float cz, float radius) const
 
bool pointInBox (float px, float py, float pz, float minX, float minY, float minZ, float maxX, float maxY, float maxZ) const
 Inclusive AABB test against [min,max] on each axis.
 
bool spheresOverlap (float x1, float y1, float z1, float r1, float x2, float y2, float z2, float r2) const
 
bool boxesOverlap (float minAx, float minAy, float minAz, float maxAx, float maxAy, float maxAz, float minBx, float minBy, float minBz, float maxBx, float maxBy, float maxBz) const
 
float raycastSphere (float ox, float oy, float oz, float dx, float dy, float dz, float cx, float cy, float cz, float radius) const
 
float raycastBox (float ox, float oy, float oz, float dx, float dy, float dz, float minX, float minY, float minZ, float maxX, float maxY, float maxZ) const
 
float raycastPlane (float ox, float oy, float oz, float dx, float dy, float dz, float px, float py, float pz, float nx, float ny, float nz) const
 Ray vs infinite plane through (px,py,pz) with normal (nx,ny,nz). Returns parametric t, or -1 if parallel / behind ray origin.
 
float closestPointOnSegment3X (float px, float py, float pz, float ax, float ay, float az, float bx, float by, float bz) const
 
float closestPointOnSegment3Y (float px, float py, float pz, float ax, float ay, float az, float bx, float by, float bz) const
 
float closestPointOnSegment3Z (float px, float py, float pz, float ax, float ay, float az, float bx, float by, float bz) const
 
float bilinear (float v00, float v10, float v01, float v11, float u, float v) const
 Bilinear sample of 4 corners (v00,v10,v01,v11) with u,v in [0,1].
 
void setRandomSeed (uint32_t seed)
 
void setRandomSeedFromTime ()
 
uint32_t getRandomSeed () const
 
float random ()
 
float randomRange (float min, float max)
 
int randomInt (int min, int maxInclusive)
 
float randomGaussian (float mean, float stddev)
 Box-Muller Gaussian (mean, stddev).
 
float hash1 (float x) const
 
float hash2 (float x, float y) const
 
float hash3 (float x, float y, float z) const
 
float noise1 (float x) const
 
float noise2 (float x, float y) const
 
float noise3 (float x, float y, float z) const
 
float perlin2 (float x, float y) const
 
float perlin3 (float x, float y, float z) const
 
float fbm2 (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const
 Fractal Brownian Motion / ridged / turbulence. octaves >= 1; lacunarity ~2; gain/persistence ~0.5.
 
float fbm3 (float x, float y, float z, int octaves=4, float lacunarity=2.f, float gain=0.5f) const
 
float ridged2 (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const
 
float ridged3 (float x, float y, float z, int octaves=4, float lacunarity=2.f, float gain=0.5f) const
 
float turbulence2 (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const
 
float voronoi2 (float x, float y) const
 Worley / Voronoi F1 distance in [0, ~1.5] (cell size 1). voronoiEdge2 = F2 - F1 (cell borders).
 
float voronoiEdge2 (float x, float y) const
 
float warpNoise2 (float x, float y, float warpAmp=1.f) const
 Domain warp: sample noise at (x,y) + warpAmp * (noise-0.5). Useful for organic terrain / caves.
 
float bezierQuadratic (float t, float p0, float p1, float p2) const
 
float bezierCubic (float t, float p0, float p1, float p2, float p3) const
 
float bezierQuadratic2X (float t, float x0, float y0, float x1, float y1, float x2, float y2) const
 
float bezierQuadratic2Y (float t, float x0, float y0, float x1, float y1, float x2, float y2) const
 
float bezierCubic2X (float t, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) const
 
float bezierCubic2Y (float t, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) const
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 
virtual std::string getName () const =0
 

详细描述

Math module — glm-backed vectors/matrices, noise, bezier, random. Script: math <- eve.Math();

No overloads: distinct names (length2/length3, noise1/noise2/…).

在文件 Math.h21 行定义.

构造及析构函数说明

◆ Math()

eve::math::Math::Math ( )

在文件 Math.cpp84 行定义.

◆ ~Math()

eve::math::Math::~Math ( )
overridedefault

成员函数说明

◆ angle2()

float eve::math::Math::angle2 ( float  x,
float  y 
) const

在文件 Math.cpp240 行定义.

引用了 x , 以及 y.

被这些函数引用 cartesianAngle().

◆ angleBetween2()

float eve::math::Math::angleBetween2 ( float  x1,
float  y1,
float  x2,
float  y2 
) const

在文件 Math.cpp242 行定义.

◆ approach()

float eve::math::Math::approach ( float  current,
float  target,
float  maxDelta 
) const

在文件 Math.cpp139 行定义.

引用了 d , 以及 sign().

◆ bezierCubic()

float eve::math::Math::bezierCubic ( float  t,
float  p0,
float  p1,
float  p2,
float  p3 
) const

在文件 Math.cpp655 行定义.

引用了 u.

被这些函数引用 bezierCubic2X() , 以及 bezierCubic2Y().

◆ bezierCubic2X()

float eve::math::Math::bezierCubic2X ( float  t,
float  x0,
float  y0,
float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3 
) const

在文件 Math.cpp673 行定义.

引用了 bezierCubic().

◆ bezierCubic2Y()

float eve::math::Math::bezierCubic2Y ( float  t,
float  x0,
float  y0,
float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3 
) const

在文件 Math.cpp678 行定义.

引用了 bezierCubic().

◆ bezierQuadratic()

float eve::math::Math::bezierQuadratic ( float  t,
float  p0,
float  p1,
float  p2 
) const

在文件 Math.cpp649 行定义.

引用了 u.

被这些函数引用 bezierQuadratic2X() , 以及 bezierQuadratic2Y().

◆ bezierQuadratic2X()

float eve::math::Math::bezierQuadratic2X ( float  t,
float  x0,
float  y0,
float  x1,
float  y1,
float  x2,
float  y2 
) const

在文件 Math.cpp663 行定义.

引用了 bezierQuadratic().

◆ bezierQuadratic2Y()

float eve::math::Math::bezierQuadratic2Y ( float  t,
float  x0,
float  y0,
float  x1,
float  y1,
float  x2,
float  y2 
) const

在文件 Math.cpp668 行定义.

引用了 bezierQuadratic().

◆ bias()

float eve::math::Math::bias ( float  t,
float  b 
) const

Schlick bias/gain — shape [0,1] distributions (procgen falloff).

在文件 Math.cpp171 行定义.

引用了 b.

被这些函数引用 gain().

◆ bilinear()

float eve::math::Math::bilinear ( float  v00,
float  v10,
float  v01,
float  v11,
float  u,
float  v 
) const

Bilinear sample of 4 corners (v00,v10,v01,v11) with u,v in [0,1].

在文件 Math.cpp503 行定义.

引用了 a, b, lerp(), u , 以及 v.

◆ boxesOverlap()

bool eve::math::Math::boxesOverlap ( float  minAx,
float  minAy,
float  minAz,
float  maxAx,
float  maxAy,
float  maxAz,
float  minBx,
float  minBy,
float  minBz,
float  maxBx,
float  maxBy,
float  maxBz 
) const

在文件 Math.cpp430 行定义.

◆ cartesianAngle()

float eve::math::Math::cartesianAngle ( float  x,
float  y 
) const

在文件 Math.cpp287 行定义.

引用了 angle2(), x , 以及 y.

◆ cartesianRadius()

float eve::math::Math::cartesianRadius ( float  x,
float  y 
) const

在文件 Math.cpp286 行定义.

引用了 length2(), x , 以及 y.

◆ circleRectOverlap()

bool eve::math::Math::circleRectOverlap ( float  cx,
float  cy,
float  radius,
float  rx,
float  ry,
float  rw,
float  rh 
) const

在文件 Math.cpp310 行定义.

引用了 cx , 以及 cy.

◆ circlesOverlap()

bool eve::math::Math::circlesOverlap ( float  x1,
float  y1,
float  r1,
float  x2,
float  y2,
float  r2 
) const

在文件 Math.cpp298 行定义.

◆ clamp()

float eve::math::Math::clamp ( float  x,
float  lo,
float  hi 
) const

在文件 Math.cpp109 行定义.

引用了 x.

◆ closestPointOnSegment2X()

float eve::math::Math::closestPointOnSegment2X ( float  px,
float  py,
float  ax,
float  ay,
float  bx,
float  by 
) const

在文件 Math.cpp400 行定义.

引用了 px.

◆ closestPointOnSegment2Y()

float eve::math::Math::closestPointOnSegment2Y ( float  px,
float  py,
float  ax,
float  ay,
float  bx,
float  by 
) const

在文件 Math.cpp405 行定义.

引用了 px.

◆ closestPointOnSegment3X()

float eve::math::Math::closestPointOnSegment3X ( float  px,
float  py,
float  pz,
float  ax,
float  ay,
float  az,
float  bx,
float  by,
float  bz 
) const

在文件 Math.cpp487 行定义.

引用了 px.

◆ closestPointOnSegment3Y()

float eve::math::Math::closestPointOnSegment3Y ( float  px,
float  py,
float  pz,
float  ax,
float  ay,
float  az,
float  bx,
float  by,
float  bz 
) const

在文件 Math.cpp492 行定义.

引用了 px.

◆ closestPointOnSegment3Z()

float eve::math::Math::closestPointOnSegment3Z ( float  px,
float  py,
float  pz,
float  ax,
float  ay,
float  az,
float  bx,
float  by,
float  bz 
) const

在文件 Math.cpp497 行定义.

引用了 px.

◆ cross2()

float eve::math::Math::cross2 ( float  x1,
float  y1,
float  x2,
float  y2 
) const

在文件 Math.cpp239 行定义.

◆ degToRad()

float eve::math::Math::degToRad ( float  deg) const

在文件 Math.cpp128 行定义.

引用了 M_PI.

◆ distance2()

float eve::math::Math::distance2 ( float  x1,
float  y1,
float  x2,
float  y2 
) const

在文件 Math.cpp226 行定义.

引用了 length2().

被这些函数引用 pointInCircle().

◆ distance3()

float eve::math::Math::distance3 ( float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
) const

在文件 Math.cpp230 行定义.

引用了 length3().

被这些函数引用 pointInSphere().

◆ dot2()

float eve::math::Math::dot2 ( float  x1,
float  y1,
float  x2,
float  y2 
) const

在文件 Math.cpp234 行定义.

◆ dot3()

float eve::math::Math::dot3 ( float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
) const

在文件 Math.cpp235 行定义.

◆ ease()

float eve::math::Math::ease ( float  t,
const std::string &  kind 
) const

Easing on [0,1]. kind: "linear"|"inQuad"|"outQuad"|"inOutQuad"|"inCubic"|"outCubic"|"inOutCubic"| "inSine"|"outSine"|"inOutSine"|"inExpo"|"outExpo"|"inOutExpo"

在文件 Math.cpp184 行定义.

引用了 kind , 以及 M_PI.

◆ fbm2()

float eve::math::Math::fbm2 ( float  x,
float  y,
int  octaves = 4,
float  lacunarity = 2.f,
float  gain = 0.5f 
) const

Fractal Brownian Motion / ridged / turbulence. octaves >= 1; lacunarity ~2; gain/persistence ~0.5.

在文件 Math.cpp560 行定义.

引用了 gain(), noise2(), x , 以及 y.

◆ fbm3()

float eve::math::Math::fbm3 ( float  x,
float  y,
float  z,
int  octaves = 4,
float  lacunarity = 2.f,
float  gain = 0.5f 
) const

在文件 Math.cpp573 行定义.

引用了 gain(), noise3(), x, y , 以及 z.

◆ fract()

float eve::math::Math::fract ( float  x) const

在文件 Math.cpp137 行定义.

引用了 x.

◆ gain()

float eve::math::Math::gain ( float  t,
float  g 
) const

在文件 Math.cpp178 行定义.

引用了 bias().

被这些函数引用 fbm2(), fbm3(), ridged2(), ridged3() , 以及 turbulence2().

◆ getRandomSeed()

uint32_t eve::math::Math::getRandomSeed ( ) const

在文件 Math.cpp521 行定义.

◆ hash1()

float eve::math::Math::hash1 ( float  x) const

在文件 Math.cpp545 行定义.

引用了 x.

◆ hash2()

float eve::math::Math::hash2 ( float  x,
float  y 
) const

在文件 Math.cpp546 行定义.

引用了 x , 以及 y.

◆ hash3()

float eve::math::Math::hash3 ( float  x,
float  y,
float  z 
) const

在文件 Math.cpp547 行定义.

引用了 x, y , 以及 z.

◆ inverseLerp()

float eve::math::Math::inverseLerp ( float  a,
float  b,
float  x 
) const

Inverse of lerp: t such that lerp(a,b,t) ≈ x.

在文件 Math.cpp160 行定义.

引用了 a, b , 以及 x.

◆ length2()

float eve::math::Math::length2 ( float  x,
float  y 
) const

在文件 Math.cpp221 行定义.

引用了 x , 以及 y.

被这些函数引用 cartesianRadius(), distance2(), normalize2X() , 以及 normalize2Y().

◆ length3()

float eve::math::Math::length3 ( float  x,
float  y,
float  z 
) const

在文件 Math.cpp222 行定义.

引用了 x, y , 以及 z.

被这些函数引用 distance3(), normalize3X(), normalize3Y() , 以及 normalize3Z().

◆ lerp()

float eve::math::Math::lerp ( float  a,
float  b,
float  t 
) const

在文件 Math.cpp114 行定义.

引用了 a , 以及 b.

被这些函数引用 bilinear().

◆ lerpAngle()

float eve::math::Math::lerpAngle ( float  a,
float  b,
float  t 
) const

在文件 Math.cpp246 行定义.

引用了 a, b , 以及 M_PI.

◆ Module_REG()

eve::math::Math::Module_REG ( Math  )

◆ newMat4()

Mat4 * eve::math::Math::newMat4 ( )

在文件 Math.cpp89 行定义.

◆ newMat4RotationZ()

Mat4 * eve::math::Math::newMat4RotationZ ( float  radians)

在文件 Math.cpp103 行定义.

引用了 m.

◆ newMat4Scale()

Mat4 * eve::math::Math::newMat4Scale ( float  sx,
float  sy,
float  sz 
)

在文件 Math.cpp97 行定义.

引用了 m.

◆ newMat4Translation()

Mat4 * eve::math::Math::newMat4Translation ( float  x,
float  y,
float  z 
)

在文件 Math.cpp91 行定义.

引用了 m, x, y , 以及 z.

◆ newVec2()

Vec2 * eve::math::Math::newVec2 ( float  x = 0.f,
float  y = 0.f 
)

在文件 Math.cpp86 行定义.

引用了 x , 以及 y.

◆ newVec3()

Vec3 * eve::math::Math::newVec3 ( float  x = 0.f,
float  y = 0.f,
float  z = 0.f 
)

在文件 Math.cpp87 行定义.

引用了 x, y , 以及 z.

◆ noise1()

float eve::math::Math::noise1 ( float  x) const

在文件 Math.cpp549 行定义.

引用了 x.

◆ noise2()

float eve::math::Math::noise2 ( float  x,
float  y 
) const

在文件 Math.cpp550 行定义.

引用了 x , 以及 y.

被这些函数引用 fbm2(), ridged2(), turbulence2() , 以及 warpNoise2().

◆ noise3()

float eve::math::Math::noise3 ( float  x,
float  y,
float  z 
) const

在文件 Math.cpp551 行定义.

引用了 x, y , 以及 z.

被这些函数引用 fbm3() , 以及 ridged3().

◆ normalize2X()

float eve::math::Math::normalize2X ( float  x,
float  y 
) const

在文件 Math.cpp254 行定义.

引用了 length2(), x , 以及 y.

◆ normalize2Y()

float eve::math::Math::normalize2Y ( float  x,
float  y 
) const

在文件 Math.cpp258 行定义.

引用了 length2(), x , 以及 y.

◆ normalize3X()

float eve::math::Math::normalize3X ( float  x,
float  y,
float  z 
) const

在文件 Math.cpp262 行定义.

引用了 length3(), x, y , 以及 z.

◆ normalize3Y()

float eve::math::Math::normalize3Y ( float  x,
float  y,
float  z 
) const

在文件 Math.cpp266 行定义.

引用了 length3(), x, y , 以及 z.

◆ normalize3Z()

float eve::math::Math::normalize3Z ( float  x,
float  y,
float  z 
) const

在文件 Math.cpp270 行定义.

引用了 length3(), x, y , 以及 z.

◆ perlin2()

float eve::math::Math::perlin2 ( float  x,
float  y 
) const

在文件 Math.cpp555 行定义.

引用了 x , 以及 y.

◆ perlin3()

float eve::math::Math::perlin3 ( float  x,
float  y,
float  z 
) const

在文件 Math.cpp556 行定义.

引用了 x, y , 以及 z.

◆ pingPong()

float eve::math::Math::pingPong ( float  t,
float  length 
) const

在文件 Math.cpp154 行定义.

引用了 wrap().

◆ pointInBox()

bool eve::math::Math::pointInBox ( float  px,
float  py,
float  pz,
float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
) const

Inclusive AABB test against [min,max] on each axis.

在文件 Math.cpp417 行定义.

引用了 px.

◆ pointInCircle()

bool eve::math::Math::pointInCircle ( float  px,
float  py,
float  cx,
float  cy,
float  radius 
) const

在文件 Math.cpp289 行定义.

引用了 cx, cy, distance2() , 以及 px.

◆ pointInRect()

bool eve::math::Math::pointInRect ( float  px,
float  py,
float  rx,
float  ry,
float  rw,
float  rh 
) const

在文件 Math.cpp294 行定义.

引用了 px.

◆ pointInSphere()

bool eve::math::Math::pointInSphere ( float  px,
float  py,
float  pz,
float  cx,
float  cy,
float  cz,
float  radius 
) const

在文件 Math.cpp411 行定义.

引用了 cx, cy, distance3() , 以及 px.

◆ polarX()

float eve::math::Math::polarX ( float  radius,
float  radians 
) const

在文件 Math.cpp284 行定义.

◆ polarY()

float eve::math::Math::polarY ( float  radius,
float  radians 
) const

在文件 Math.cpp285 行定义.

◆ quantize()

float eve::math::Math::quantize ( float  x,
float  stepSize 
) const

在文件 Math.cpp211 行定义.

引用了 x.

◆ radToDeg()

float eve::math::Math::radToDeg ( float  rad) const

在文件 Math.cpp129 行定义.

引用了 M_PI.

◆ random()

float eve::math::Math::random ( )

在文件 Math.cpp523 行定义.

◆ randomGaussian()

float eve::math::Math::randomGaussian ( float  mean,
float  stddev 
)

Box-Muller Gaussian (mean, stddev).

在文件 Math.cpp540 行定义.

◆ randomInt()

int eve::math::Math::randomInt ( int  min,
int  maxInclusive 
)

在文件 Math.cpp534 行定义.

◆ randomRange()

float eve::math::Math::randomRange ( float  min,
float  max 
)

在文件 Math.cpp528 行定义.

◆ raycastBox()

float eve::math::Math::raycastBox ( float  ox,
float  oy,
float  oz,
float  dx,
float  dy,
float  dz,
float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
) const

在文件 Math.cpp455 行定义.

引用了 d.

◆ raycastCircle2()

float eve::math::Math::raycastCircle2 ( float  ox,
float  oy,
float  dx,
float  dy,
float  cx,
float  cy,
float  radius 
) const

Ray vs circle. Hit point = (ox,oy) + t*(dx,dy). Returns t >= 0 on hit, else -1. Direction need not be unit; for a segment use dir = B-A and accept t in [0,1].

在文件 Math.cpp341 行定义.

引用了 a, b, c, cx, cy , 以及 s.

◆ raycastPlane()

float eve::math::Math::raycastPlane ( float  ox,
float  oy,
float  oz,
float  dx,
float  dy,
float  dz,
float  px,
float  py,
float  pz,
float  nx,
float  ny,
float  nz 
) const

Ray vs infinite plane through (px,py,pz) with normal (nx,ny,nz). Returns parametric t, or -1 if parallel / behind ray origin.

在文件 Math.cpp479 行定义.

引用了 px.

◆ raycastRect2()

float eve::math::Math::raycastRect2 ( float  ox,
float  oy,
float  dx,
float  dy,
float  rx,
float  ry,
float  rw,
float  rh 
) const

Ray vs axis-aligned rect (x,y,w,h). Returns parametric t >= 0, else -1.

在文件 Math.cpp359 行定义.

引用了 d.

◆ raycastSphere()

float eve::math::Math::raycastSphere ( float  ox,
float  oy,
float  oz,
float  dx,
float  dy,
float  dz,
float  cx,
float  cy,
float  cz,
float  radius 
) const

在文件 Math.cpp437 行定义.

引用了 a, b, c, cx, cy , 以及 s.

◆ rectsOverlap()

bool eve::math::Math::rectsOverlap ( float  x1,
float  y1,
float  w1,
float  h1,
float  x2,
float  y2,
float  w2,
float  h2 
) const

在文件 Math.cpp305 行定义.

◆ remap()

float eve::math::Math::remap ( float  x,
float  inMin,
float  inMax,
float  outMin,
float  outMax 
) const

在文件 Math.cpp122 行定义.

引用了 x.

◆ ridged2()

float eve::math::Math::ridged2 ( float  x,
float  y,
int  octaves = 4,
float  lacunarity = 2.f,
float  gain = 0.5f 
) const

在文件 Math.cpp586 行定义.

引用了 gain(), n, noise2(), x , 以及 y.

◆ ridged3()

float eve::math::Math::ridged3 ( float  x,
float  y,
float  z,
int  octaves = 4,
float  lacunarity = 2.f,
float  gain = 0.5f 
) const

在文件 Math.cpp602 行定义.

引用了 gain(), n, noise3(), x, y , 以及 z.

◆ rotate2X()

float eve::math::Math::rotate2X ( float  x,
float  y,
float  radians 
) const

Rotate (x,y) by radians around origin.

在文件 Math.cpp275 行定义.

引用了 c, s, x , 以及 y.

◆ rotate2Y()

float eve::math::Math::rotate2Y ( float  x,
float  y,
float  radians 
) const

在文件 Math.cpp279 行定义.

引用了 c, s, x , 以及 y.

◆ segmentsIntersect()

bool eve::math::Math::segmentsIntersect ( float  ax,
float  ay,
float  bx,
float  by,
float  cx,
float  cy,
float  dx,
float  dy 
) const

True if segments AB and CD intersect (including endpoints).

在文件 Math.cpp319 行定义.

引用了 cx, cy , 以及 px.

◆ setRandomSeed()

void eve::math::Math::setRandomSeed ( uint32_t  seed)

在文件 Math.cpp509 行定义.

引用了 seed.

被这些函数引用 setRandomSeedFromTime().

◆ setRandomSeedFromTime()

void eve::math::Math::setRandomSeedFromTime ( )

在文件 Math.cpp514 行定义.

引用了 setRandomSeed().

◆ sign()

float eve::math::Math::sign ( float  x) const

在文件 Math.cpp131 行定义.

引用了 x.

被这些函数引用 approach().

◆ smootherstep()

float eve::math::Math::smootherstep ( float  edge0,
float  edge1,
float  x 
) const

在文件 Math.cpp165 行定义.

引用了 x.

◆ smoothstep()

float eve::math::Math::smoothstep ( float  edge0,
float  edge1,
float  x 
) const

在文件 Math.cpp116 行定义.

引用了 x.

◆ snap()

float eve::math::Math::snap ( float  x,
float  grid 
) const

在文件 Math.cpp216 行定义.

引用了 x.

◆ spheresOverlap()

bool eve::math::Math::spheresOverlap ( float  x1,
float  y1,
float  z1,
float  r1,
float  x2,
float  y2,
float  z2,
float  r2 
) const

在文件 Math.cpp422 行定义.

◆ step()

float eve::math::Math::step ( float  edge,
float  x 
) const

在文件 Math.cpp209 行定义.

引用了 x.

◆ turbulence2()

float eve::math::Math::turbulence2 ( float  x,
float  y,
int  octaves = 4,
float  lacunarity = 2.f,
float  gain = 0.5f 
) const

在文件 Math.cpp618 行定义.

引用了 gain(), noise2(), x , 以及 y.

◆ voronoi2()

float eve::math::Math::voronoi2 ( float  x,
float  y 
) const

Worley / Voronoi F1 distance in [0, ~1.5] (cell size 1). voronoiEdge2 = F2 - F1 (cell borders).

在文件 Math.cpp631 行定义.

引用了 x , 以及 y.

◆ voronoiEdge2()

float eve::math::Math::voronoiEdge2 ( float  x,
float  y 
) const

在文件 Math.cpp637 行定义.

引用了 x , 以及 y.

◆ warpNoise2()

float eve::math::Math::warpNoise2 ( float  x,
float  y,
float  warpAmp = 1.f 
) const

Domain warp: sample noise at (x,y) + warpAmp * (noise-0.5). Useful for organic terrain / caves.

在文件 Math.cpp643 行定义.

引用了 noise2(), x , 以及 y.

◆ wrap()

float eve::math::Math::wrap ( float  x,
float  lo,
float  hi 
) const

在文件 Math.cpp145 行定义.

引用了 x.

被这些函数引用 pingPong().


该类的文档由以下文件生成: