Material defined in a .mtl file

Introduced properties

fun ambient: Vec3

gamnit :: MtlDef :: ambient

Ambient color
protected fun ambient=(ambient: Vec3)

gamnit :: MtlDef :: ambient=

Ambient color
fun diffuse: Vec3

gamnit :: MtlDef :: diffuse

Diffuse color
protected fun diffuse=(diffuse: Vec3)

gamnit :: MtlDef :: diffuse=

Diffuse color
fun dissolved: Float

gamnit :: MtlDef :: dissolved

Dissolved level, where 1.0 is fully visible
protected fun dissolved=(dissolved: Float)

gamnit :: MtlDef :: dissolved=

Dissolved level, where 1.0 is fully visible
fun illumination_model: Int

gamnit :: MtlDef :: illumination_model

Illumination model
protected fun illumination_model=(illumination_model: Int)

gamnit :: MtlDef :: illumination_model=

Illumination model
fun map_ambient: nullable String

gamnit :: MtlDef :: map_ambient

Ambient map
protected fun map_ambient=(map_ambient: nullable String)

gamnit :: MtlDef :: map_ambient=

Ambient map
fun map_bump: nullable String

gamnit :: MtlDef :: map_bump

Bump map or normals texture
protected fun map_bump=(map_bump: nullable String)

gamnit :: MtlDef :: map_bump=

Bump map or normals texture
fun map_diffuse: nullable String

gamnit :: MtlDef :: map_diffuse

Diffuse map
protected fun map_diffuse=(map_diffuse: nullable String)

gamnit :: MtlDef :: map_diffuse=

Diffuse map
fun map_exponent: nullable String

gamnit :: MtlDef :: map_exponent

Specular exponent map
protected fun map_exponent=(map_exponent: nullable String)

gamnit :: MtlDef :: map_exponent=

Specular exponent map
fun map_specular: nullable String

gamnit :: MtlDef :: map_specular

Specular reflectivity map
protected fun map_specular=(map_specular: nullable String)

gamnit :: MtlDef :: map_specular=

Specular reflectivity map
fun maps: Array[String]

gamnit :: MtlDef :: maps

Collect non-null maps from map_diffuse, map_bump, map_specular, map_exponent
fun name: String

gamnit :: MtlDef :: name

Name of this material
protected fun name=(name: String)

gamnit :: MtlDef :: name=

Name of this material
fun specular: Vec3

gamnit :: MtlDef :: specular

Specular color
protected fun specular=(specular: Vec3)

gamnit :: MtlDef :: specular=

Specular color
fun transparency: Float

gamnit :: MtlDef :: transparency

Transparency level, where 1.0 is fully invisible

Redefined properties

redef type SELF: MtlDef

gamnit $ MtlDef :: SELF

Type of this instance, automatically specialized in every class

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun ambient: Vec3

gamnit :: MtlDef :: ambient

Ambient color
protected fun ambient=(ambient: Vec3)

gamnit :: MtlDef :: ambient=

Ambient color
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun diffuse: Vec3

gamnit :: MtlDef :: diffuse

Diffuse color
protected fun diffuse=(diffuse: Vec3)

gamnit :: MtlDef :: diffuse=

Diffuse color
fun dissolved: Float

gamnit :: MtlDef :: dissolved

Dissolved level, where 1.0 is fully visible
protected fun dissolved=(dissolved: Float)

gamnit :: MtlDef :: dissolved=

Dissolved level, where 1.0 is fully visible
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun illumination_model: Int

gamnit :: MtlDef :: illumination_model

Illumination model
protected fun illumination_model=(illumination_model: Int)

gamnit :: MtlDef :: illumination_model=

Illumination model
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun map_ambient: nullable String

gamnit :: MtlDef :: map_ambient

Ambient map
protected fun map_ambient=(map_ambient: nullable String)

gamnit :: MtlDef :: map_ambient=

Ambient map
fun map_bump: nullable String

gamnit :: MtlDef :: map_bump

Bump map or normals texture
protected fun map_bump=(map_bump: nullable String)

gamnit :: MtlDef :: map_bump=

Bump map or normals texture
fun map_diffuse: nullable String

gamnit :: MtlDef :: map_diffuse

Diffuse map
protected fun map_diffuse=(map_diffuse: nullable String)

gamnit :: MtlDef :: map_diffuse=

Diffuse map
fun map_exponent: nullable String

gamnit :: MtlDef :: map_exponent

Specular exponent map
protected fun map_exponent=(map_exponent: nullable String)

gamnit :: MtlDef :: map_exponent=

Specular exponent map
fun map_specular: nullable String

gamnit :: MtlDef :: map_specular

Specular reflectivity map
protected fun map_specular=(map_specular: nullable String)

gamnit :: MtlDef :: map_specular=

Specular reflectivity map
fun maps: Array[String]

gamnit :: MtlDef :: maps

Collect non-null maps from map_diffuse, map_bump, map_specular, map_exponent
fun name: String

gamnit :: MtlDef :: name

Name of this material
protected fun name=(name: String)

gamnit :: MtlDef :: name=

Name of this material
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
fun specular: Vec3

gamnit :: MtlDef :: specular

Specular color
protected fun specular=(specular: Vec3)

gamnit :: MtlDef :: specular=

Specular color
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
fun transparency: Float

gamnit :: MtlDef :: transparency

Transparency level, where 1.0 is fully invisible
package_diagram gamnit::MtlDef MtlDef core::Object Object gamnit::MtlDef->core::Object

Parents

interface Object

core :: Object

The root of the class hierarchy.

Class definitions

gamnit $ MtlDef
# Material defined in a `.mtl` file
class MtlDef

	# Name of this material
	var name: String

	# Ambient color
	var ambient = new Vec3 is lazy

	# Diffuse color
	var diffuse = new Vec3 is lazy

	# Specular color
	var specular = new Vec3 is lazy

	# Dissolved level, where 1.0 is fully visible
	var dissolved = 1.0

	# Transparency level, where 1.0 is fully invisible
	fun transparency: Float do return 1.0 - dissolved

	# Illumination model
	var illumination_model = 0

	# Ambient map
	var map_ambient: nullable String = null

	# Diffuse map
	var map_diffuse: nullable String = null

	# Bump map or normals texture
	var map_bump: nullable String = null

	# Specular reflectivity map
	var map_specular: nullable String = null

	# Specular exponent map
	var map_exponent: nullable String = null

	# Collect non-null maps from `map_diffuse, map_bump, map_specular, map_exponent`
	fun maps: Array[String]
	do
		return [for m in [map_ambient, map_diffuse, map_bump, map_specular, map_exponent] do if m != null then m]
	end
end
lib/gamnit/model_parsers/mtl.nit:92,1--136,3