some additional vector constructors
This commit is contained in:
@@ -155,11 +155,20 @@ float __constructor(const float f)
|
||||
__retVal = f.x;
|
||||
}
|
||||
|
||||
|
||||
//// vec2 constructors
|
||||
|
||||
vec2 __constructor(const float f)
|
||||
{
|
||||
__retVal.xy = f.xx;
|
||||
}
|
||||
|
||||
vec2 __constructor(const float x, const float y)
|
||||
{
|
||||
__retVal.x = x;
|
||||
__retVal.y = y;
|
||||
}
|
||||
|
||||
vec2 __constructor (const int i) {
|
||||
float x;
|
||||
__asm int_to_float x, i;
|
||||
@@ -170,11 +179,26 @@ vec2 __constructor (const bool b) {
|
||||
return vec2 (b ? 1.0 : 0.0);
|
||||
}
|
||||
|
||||
vec2 __constructor(const vec3 v)
|
||||
{
|
||||
__retVal.xy = v.xy;
|
||||
}
|
||||
|
||||
|
||||
//// vec3 constructors
|
||||
|
||||
vec3 __constructor(const float f)
|
||||
{
|
||||
__retVal.xyz = f.xxx;
|
||||
}
|
||||
|
||||
vec3 __constructor(const float x, const float y, const float z)
|
||||
{
|
||||
__retVal.x = x;
|
||||
__retVal.y = y;
|
||||
__retVal.z = z;
|
||||
}
|
||||
|
||||
vec3 __constructor (const int i) {
|
||||
float x;
|
||||
__asm int_to_float x, i;
|
||||
@@ -191,6 +215,8 @@ vec3 __constructor(const vec4 v)
|
||||
}
|
||||
|
||||
|
||||
//// vec4 constructors
|
||||
|
||||
vec4 __constructor(const float f)
|
||||
{
|
||||
__retVal.xyzw = f.xxxx;
|
||||
@@ -484,7 +510,9 @@ float __operator * (const float a, const float b)
|
||||
|
||||
float __operator / (const float a, const float b)
|
||||
{
|
||||
__asm float_divide __retVal, a, b;
|
||||
float bInv;
|
||||
__asm float_rcp bInv.x, b.x;
|
||||
__asm vec4_multiply __retVal.x, a, bInv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user