easyx_framework V1.0.0
基于easyx的c++游戏框架
 
载入中...
搜索中...
未找到
Perlin类 参考

Perlin类 更多...

#include <Perlin.h>

Public 成员函数

 Perlin (int repeat=-1)
 构造函数来生成排列数
 
double OctavePerlin (double x, double y, double z, int octaves, double persistence)
 
double perlin (double x, double y, double z)
 获取影响值
 
int inc (int num)
 相当于+1
 

静态 Public 成员函数

static double grad (int hash, double x, double y, double z)
 梯度值
 
static double fade (double t)
 参数方程 曲线五次 大概图像慢-块-慢 0~1
 
static double lerp (double a, double b, double x)
 线性插值
 

Public 属性

int repeat = -1
 两倍排列数来回避超出区间 0~255
 

Private 属性

std::vector< int > p
 

详细描述

Perlin类

参见
ImageToolkit

构造及析构函数说明

◆ Perlin()

Perlin::Perlin ( int repeat = -1)
inline

构造函数来生成排列数

参数
[in]repeat什么时候开始重复 默认-1表示不起作用

成员函数说明

◆ fade()

static double Perlin::fade ( double t)
inlinestatic

参数方程 曲线五次 大概图像慢-块-慢 0~1

◆ grad()

static double Perlin::grad ( int hash,
double x,
double y,
double z )
inlinestatic

梯度值

参数
[in]hash哈希值 0~255

◆ inc()

int Perlin::inc ( int num)
inline

相当于+1

◆ lerp()

static double Perlin::lerp ( double a,
double b,
double x )
inlinestatic

线性插值

参数
[in]a左区间
[in]b右区间
x约束值

◆ OctavePerlin()

double Perlin::OctavePerlin ( double x,
double y,
double z,
int octaves,
double persistence )
inline

◆ perlin()

double Perlin::perlin ( double x,
double y,
double z )
inline

获取影响值

备注
函数是三维的,二维只需要z取0 参数坐标还要映射到晶格体上 晶格体决定大小
参数
[in]x坐标x
[in]y坐标y
[in]z坐标z

类成员变量说明

◆ p

std::vector<int> Perlin::p
private

◆ repeat

int Perlin::repeat = -1

两倍排列数来回避超出区间 0~255

什么时候开始重复 默认-1表示不起作用