osg.Uniform¶
-
class
osg.Uniform¶ Represents: c++ class Wraps: osg::Uniform Bases: osg.Objectosg.UniformencapsulatesglUniform(https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glUniform.xml) values. For convenience and visibility in Lua there are a number of setters and getters kind ofset<VaueType><Dimension>andget<VaueType><Dimension>(e.g.osg.Uniform.setInt2()andosg.Uniform.getInt2()) for setting and geting values of corresspondingosg.Uniformobject. Static functions for creating anosg.Uniformof specified type are also provided and has signatureosg.Uniform.<ValueType><Dimension>(e.g.osg.Uniform.Vec2d()).Constructors:
-
osg.Uniform()¶
-
osg.Uniform(osg.Uniform.Type type, std.string name, int numElements) -
Parameters: - type (
osg.Uniform.Type) – - name (
std.string) – - numElements (
int) –
- type (
-
osg.Uniform(osg.Uniform.Type type, std.string name) -
Parameters: - type (
osg.Uniform.Type) – - name (
std.string) –
- type (
Methods:
-
:
setType(osg.Uniform.Type type)¶ Set the type of glUniform, ensuring it is only set once.
Parameters: type ( osg.Uniform.Type) –
-
:
getType()¶ Get the type of glUniform as enum.
Return type: osg.Uniform.Type
-
:
setNumElements(int num)¶ Set the length of a uniform, ensuring it is only set once (1 == scalar).
Parameters: num ( int) –
-
:
getNumElements()¶ Get the number of GLSL elements of the
osg.Uniform(1 == scalar).Return type: int
-
:
setFloat(double v)¶ -
Parameters: v ( double) –
-
:
setDouble(double v)¶ -
Parameters: v ( double) –
-
:
setInt(int v)¶ -
Parameters: v ( int) –
-
:
setInt2(int v1, int v2)¶ -
Parameters: - v1 (
int) – - v2 (
int) –
- v1 (
-
:
setInt3(int v1, int v2, int v3)¶ -
Parameters: - v1 (
int) – - v2 (
int) – - v3 (
int) –
- v1 (
-
:
setInt4(int v1, int v2, int v3, int v4)¶ -
Parameters: - v1 (
int) – - v2 (
int) – - v3 (
int) – - v4 (
int) –
- v1 (
-
:
setUnsigned(unsigned v)¶ -
Parameters: v ( unsigned) –
-
:
setUnsigned2(unsigned v1, unsigned v2)¶ -
Parameters: - v1 (
unsigned) – - v2 (
unsigned) –
- v1 (
-
:
setUnsigned3(unsigned v1, unsigned v2, unsigned v3)¶ -
Parameters: - v1 (
unsigned) – - v2 (
unsigned) – - v3 (
unsigned) –
- v1 (
-
:
setUnsigned4(unsigned v1, unsigned v2, unsigned v3, unsigned v4)¶ -
Parameters: - v1 (
unsigned) – - v2 (
unsigned) – - v3 (
unsigned) – - v4 (
unsigned) –
- v1 (
-
:
setBool(bool v)¶ -
Parameters: v ( bool) –
-
:
setBool2(bool v1, bool v2)¶ -
Parameters: - v1 (
bool) – - v2 (
bool) –
- v1 (
-
:
setBool3(bool v1, bool v2, bool v3)¶ -
Parameters: - v1 (
bool) – - v2 (
bool) – - v3 (
bool) –
- v1 (
-
:
setBool4(bool v1, bool v2, bool v3, bool v4)¶ -
Parameters: - v1 (
bool) – - v2 (
bool) – - v3 (
bool) – - v4 (
bool) –
- v1 (
-
:
setMatrix(osg.Matrix v)¶ -
Parameters: v ( osg.Matrix) –
-
:
setMatrix2(osg.Matrix2 v)¶ -
Parameters: v ( osg.Matrix2) –
-
:
setMatrix3(osg.Matrix3 v)¶ -
Parameters: v ( osg.Matrix3) –
-
:
getFloat()¶
-
:
getDouble()¶
-
:
getInt()¶
-
:
getInt2()¶
-
:
getInt3()¶
-
:
getInt4()¶
-
:
getUnsigned()¶
-
:
getUnsigned2()¶
-
:
getUnsigned3()¶
-
:
getUnsigned4()¶
-
:
getBool()¶
-
:
getBool2()¶
-
:
getBool3()¶
-
:
getBool4()¶
-
:
getVec2f()¶
-
:
getVec2d()¶
-
:
getVec3f()¶
-
:
getVec3d()¶
-
:
getVec4f()¶
-
:
getVec4d()¶
-
:
getMatrix()¶
-
:
getMatrix2()¶
-
:
getMatrix3()¶
-
:
setElement(unsigned index, osg.Matrix m4)¶ -
Parameters: - index (
unsigned) – - m4 (
osg.Matrix) –
Return type: bool - index (
-
:
setElement(unsigned index, osg.Vec2 v2) -
Parameters: - index (
unsigned) – - v2 (
osg.Vec2) –
Return type: bool - index (
-
:
setElement(unsigned index, osg.Vec3 v3) -
Parameters: - index (
unsigned) – - v3 (
osg.Vec3) –
Return type: bool - index (
-
:
setElement(unsigned index, osg.Vec4 v4) -
Parameters: - index (
unsigned) – - v4 (
osg.Vec4) –
Return type: bool - index (
-
:
setUpdateCallback(osg.UniformCallback uc)¶ -
Parameters: uc ( osg.UniformCallback) –
-
:
getUpdateCallback()¶ -
Return type: osg.UniformCallback
-
:
setEventCallback(osg.UniformCallback ec)¶ -
Parameters: ec ( osg.UniformCallback) –
-
:
getEventCallback()¶ -
Return type: osg.UniformCallback
-
:
dirty()¶
Static Methods:
-
.
getTypename(osg.Uniform.Type type)¶ Return the name of a
osg.Uniform.Typeenum as string.Parameters: type ( osg.Uniform.Type) –Return type: std.string
-
.
getTypeId(std.string name)¶ Return the
osg.Uniform.Typeenum of aosg.Uniformtypename string.Parameters: name ( std.string) –Return type: osg.Uniform.Type
-
.
getGlApiType(osg.Uniform.Type type)¶ Return the GL API type corresponding to a GLSL type
Parameters: type ( osg.Uniform.Type) –Return type: osg.Uniform.Type
-
.
getInternalArrayType(osg.Uniform.Type type)¶ Return the internal data array type corresponding to a GLSL type
Parameters: type ( osg.Uniform.Type) –Return type: GLenum.Value
-
.
Float(std.string name, double v)¶ -
Parameters: - name (
std.string) – - v (
double) –
Return type: - name (
-
.
Double(std.string name, double v)¶ -
Parameters: - name (
std.string) – - v (
double) –
Return type: - name (
-
.
Int(std.string name, int v)¶ -
Parameters: - name (
std.string) – - v (
int) –
Return type: - name (
-
.
Unsigned(std.string name, unsigned v)¶ -
Parameters: - name (
std.string) – - v (
unsigned) –
Return type: - name (
-
.
Bool(std.string name, bool v)¶ -
Parameters: - name (
std.string) – - v (
bool) –
Return type: - name (
-
.
Vec2f(std.string name, osg.Vec2 v)¶ -
Parameters: - name (
std.string) – - v (
osg.Vec2) –
Return type: - name (
-
.
Vec2d(std.string name, osg.Vec2 v)¶ -
Parameters: - name (
std.string) – - v (
osg.Vec2) –
Return type: - name (
-
.
Vec3f(std.string name, osg.Vec3 v)¶ -
Parameters: - name (
std.string) – - v (
osg.Vec3) –
Return type: - name (
-
.
Vec3d(std.string name, osg.Vec3 v)¶ -
Parameters: - name (
std.string) – - v (
osg.Vec3) –
Return type: - name (
-
.
Vec4f(std.string name, osg.Vec4 v)¶ -
Parameters: - name (
std.string) – - v (
osg.Vec4) –
Return type: - name (
-
.
Vec4d(std.string name, osg.Vec4 v)¶ -
Parameters: - name (
std.string) – - v (
osg.Vec4) –
Return type: - name (
-
.
Matrix(std.string name, osg.Matrix v)¶ -
Parameters: - name (
std.string) – - v (
osg.Matrix) –
Return type: - name (
-
.
Matrix2(std.string name, osg.Matrix2 v)¶ -
Parameters: - name (
std.string) – - v (
osg.Matrix2) –
Return type: - name (
-
.
Matrix3(std.string name, osg.Matrix3 v)¶ -
Parameters: - name (
std.string) – - v (
osg.Matrix3) –
Return type: - name (
-
.
Int2(std.string name, int v1, int v2)¶ -
Parameters: - name (
std.string) – - v1 (
int) – - v2 (
int) –
Return type: - name (
-
.
Int3(std.string name, int v1, int v2, int v3)¶ -
Parameters: - name (
std.string) – - v1 (
int) – - v2 (
int) – - v3 (
int) –
Return type: - name (
-
.
Int4(std.string name, int v1, int v2, int v3, int v4)¶ -
Parameters: - name (
std.string) – - v1 (
int) – - v2 (
int) – - v3 (
int) – - v4 (
int) –
Return type: - name (
-
.
Unsigned2(std.string name, unsigned v1, unsigned v2)¶ -
Parameters: - name (
std.string) – - v1 (
unsigned) – - v2 (
unsigned) –
Return type: - name (
-
.
Unsigned3(std.string name, unsigned v1, unsigned v2, unsigned v3)¶ -
Parameters: - name (
std.string) – - v1 (
unsigned) – - v2 (
unsigned) – - v3 (
unsigned) –
Return type: - name (
-
.
Unsigned4(std.string name, unsigned v1, unsigned v2, unsigned v3, unsigned v4)¶ -
Parameters: - name (
std.string) – - v1 (
unsigned) – - v2 (
unsigned) – - v3 (
unsigned) – - v4 (
unsigned) –
Return type: - name (
-
.
Bool2(std.string name, bool v1, bool v2)¶ -
Parameters: - name (
std.string) – - v1 (
bool) – - v2 (
bool) –
Return type: - name (
-
.
Bool3(std.string name, bool v1, bool v2, bool v3)¶ -
Parameters: - name (
std.string) – - v1 (
bool) – - v2 (
bool) – - v3 (
bool) –
Return type: - name (
-
.
Bool4(std.string name, bool v1, bool v2, bool v3, bool v4)¶ -
Parameters: - name (
std.string) – - v1 (
bool) – - v2 (
bool) – - v3 (
bool) – - v4 (
bool) –
Return type: - name (
-