17 INLINE
unsigned char LinearNoiseForce::
18 prn_lookup(
int index)
const {
19 return _prn_table[index & 255];
25 INLINE
unsigned char LinearNoiseForce::
26 get_prn_entry(
const LPoint3& point)
const {
27 return prn_lookup((
int)(point[0] + prn_lookup((
int)(point[1] + prn_lookup((
int)point[2])))));
33 INLINE
unsigned char LinearNoiseForce::
34 get_prn_entry(
const PN_stdfloat x,
const PN_stdfloat y,
const PN_stdfloat z)
const {
35 return prn_lookup((
int)(x + prn_lookup((
int)(y + prn_lookup((
int)z)))));
41 INLINE LVector3& LinearNoiseForce::
42 get_lattice_entry(
const LPoint3& point) {
43 return _gradient_table[get_prn_entry(point)];
49 INLINE LVector3& LinearNoiseForce::
50 get_lattice_entry(
const PN_stdfloat x,
const PN_stdfloat y,
const PN_stdfloat z) {
51 return _gradient_table[get_prn_entry(x, y, z)];
57 INLINE PN_stdfloat LinearNoiseForce::
58 cubic_step(
const PN_stdfloat x)
const {
59 return x * x * ((2 * x) - 3);
65 INLINE LVector3 LinearNoiseForce::
66 vlerp(
const PN_stdfloat t,
const LVector3& v0,
const LVector3& v1)
const {
67 return v0 + ((v1 - v0) * t);