當前位置: 首頁>>代碼示例>>Java>>正文


Java Usage.BoneWeight方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.graphics.VertexAttributes.Usage.BoneWeight方法的典型用法代碼示例。如果您正苦於以下問題:Java Usage.BoneWeight方法的具體用法?Java Usage.BoneWeight怎麽用?Java Usage.BoneWeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.graphics.VertexAttributes.Usage的用法示例。


在下文中一共展示了Usage.BoneWeight方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: canRender

import com.badlogic.gdx.graphics.VertexAttributes.Usage; //導入方法依賴的package包/類
@Override
public boolean canRender (Renderable renderable) {
	if (renderable.material.has(BlendingAttribute.Type)) {
		if ((materialMask & BlendingAttribute.Type) != BlendingAttribute.Type)
			return false;
		if (renderable.material.has(TextureAttribute.Diffuse) != ((materialMask & TextureAttribute.Diffuse) == TextureAttribute.Diffuse))
			return false;
	}
	final boolean skinned = ((renderable.mesh.getVertexAttributes().getMask() & Usage.BoneWeight) == Usage.BoneWeight);
	if (skinned != (numBones > 0)) return false;
	if (!skinned) return true;
	int w = 0;
	final int n = renderable.mesh.getVertexAttributes().size();
	for (int i = 0; i < n; i++) {
		final VertexAttribute attr = renderable.mesh.getVertexAttributes().get(i);
		if (attr.usage == Usage.BoneWeight) w |= (1 << attr.unit);
	}
	return w == weights;
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:20,代碼來源:DepthShader.java

示例2: DepthShader

import com.badlogic.gdx.graphics.VertexAttributes.Usage; //導入方法依賴的package包/類
public DepthShader (final Renderable renderable, final Config config, final ShaderProgram shaderProgram) {
	super(renderable, config, shaderProgram);
	this.numBones = renderable.bones == null ? 0 : config.numBones;
	int w = 0;
	final int n = renderable.mesh.getVertexAttributes().size();
	for (int i = 0; i < n; i++) {
		final VertexAttribute attr = renderable.mesh.getVertexAttributes().get(i);
		if (attr.usage == Usage.BoneWeight) w |= (1 << attr.unit);
	}
	weights = w;
	alphaTestAttribute = new FloatAttribute(FloatAttribute.AlphaTest, config.defaultAlphaTest);
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:13,代碼來源:DepthShader.java

示例3: BoneWeight

import com.badlogic.gdx.graphics.VertexAttributes.Usage; //導入方法依賴的package包/類
public static VertexAttribute BoneWeight (int unit) {
	return new VertexAttribute(Usage.BoneWeight, 2, "a_boneWeight" + unit, unit);
}
 
開發者ID:Osaris31,項目名稱:exterminate,代碼行數:4,代碼來源:VertexAttribute.java

示例4: createPrefix

import com.badlogic.gdx.graphics.VertexAttributes.Usage; //導入方法依賴的package包/類
public static String createPrefix (final Renderable renderable, final Config config) {
	String prefix = "";
	final long mask = renderable.material.getMask();
	final long attributes = renderable.mesh.getVertexAttributes().getMask();
	if (and(attributes, Usage.Position)) prefix += "#define positionFlag\n";
	if (or(attributes, Usage.Color | Usage.ColorPacked)) prefix += "#define colorFlag\n";
	if (and(attributes, Usage.BiNormal)) prefix += "#define binormalFlag\n";
	if (and(attributes, Usage.Tangent)) prefix += "#define tangentFlag\n";
	if (and(attributes, Usage.Normal)) prefix += "#define normalFlag\n";
	if (and(attributes, Usage.Normal) || and(attributes, Usage.Tangent | Usage.BiNormal)) {
		if (renderable.environment != null) {
			prefix += "#define lightingFlag\n";
			prefix += "#define ambientCubemapFlag\n";
			prefix += "#define numDirectionalLights " + config.numDirectionalLights + "\n";
			prefix += "#define numPointLights " + config.numPointLights + "\n";
			if (renderable.environment.has(ColorAttribute.Fog)) {
				prefix += "#define fogFlag\n";
			}
			if (renderable.environment.shadowMap != null) prefix += "#define shadowMapFlag\n";
			if (renderable.material.has(CubemapAttribute.EnvironmentMap)
				|| renderable.environment.has(CubemapAttribute.EnvironmentMap)) prefix += "#define environmentCubemapFlag\n";
		}
	}
	final int n = renderable.mesh.getVertexAttributes().size();
	for (int i = 0; i < n; i++) {
		final VertexAttribute attr = renderable.mesh.getVertexAttributes().get(i);
		if (attr.usage == Usage.BoneWeight)
			prefix += "#define boneWeight" + attr.unit + "Flag\n";
		else if (attr.usage == Usage.TextureCoordinates) prefix += "#define texCoord" + attr.unit + "Flag\n";
	}
	if ((mask & BlendingAttribute.Type) == BlendingAttribute.Type) prefix += "#define " + BlendingAttribute.Alias + "Flag\n";
	if ((mask & TextureAttribute.Diffuse) == TextureAttribute.Diffuse) {
		prefix += "#define " + TextureAttribute.DiffuseAlias + "Flag\n";
		prefix += "#define " + TextureAttribute.DiffuseAlias + "Coord texCoord0\n"; // FIXME implement UV mapping
	}
	if ((mask & TextureAttribute.Specular) == TextureAttribute.Specular) {
		prefix += "#define " + TextureAttribute.SpecularAlias + "Flag\n";
		prefix += "#define " + TextureAttribute.SpecularAlias + "Coord texCoord0\n"; // FIXME implement UV mapping
	}
	if ((mask & TextureAttribute.Normal) == TextureAttribute.Normal) {
		prefix += "#define " + TextureAttribute.NormalAlias + "Flag\n";
		prefix += "#define " + TextureAttribute.NormalAlias + "Coord texCoord0\n"; // FIXME implement UV mapping
	}
	if ((mask & TextureAttribute.Emissive) == TextureAttribute.Emissive) {
		prefix += "#define " + TextureAttribute.EmissiveAlias + "Flag\n";
		prefix += "#define " + TextureAttribute.EmissiveAlias + "Coord texCoord0\n"; // FIXME implement UV mapping
	}
	if ((mask & TextureAttribute.Reflection) == TextureAttribute.Reflection) {
		prefix += "#define " + TextureAttribute.ReflectionAlias + "Flag\n";
		prefix += "#define " + TextureAttribute.ReflectionAlias + "Coord texCoord0\n"; // FIXME implement UV mapping
	}
	if ((mask & TextureAttribute.Ambient) == TextureAttribute.Ambient) {
		prefix += "#define " + TextureAttribute.AmbientAlias + "Flag\n";
		prefix += "#define " + TextureAttribute.AmbientAlias + "Coord texCoord0\n"; // FIXME implement UV mapping
	}
	if ((mask & ColorAttribute.Diffuse) == ColorAttribute.Diffuse)
		prefix += "#define " + ColorAttribute.DiffuseAlias + "Flag\n";
	if ((mask & ColorAttribute.Specular) == ColorAttribute.Specular)
		prefix += "#define " + ColorAttribute.SpecularAlias + "Flag\n";
	if ((mask & ColorAttribute.Emissive) == ColorAttribute.Emissive)
		prefix += "#define " + ColorAttribute.EmissiveAlias + "Flag\n";
	if ((mask & ColorAttribute.Reflection) == ColorAttribute.Reflection)
		prefix += "#define " + ColorAttribute.ReflectionAlias + "Flag\n";
	if ((mask & FloatAttribute.Shininess) == FloatAttribute.Shininess)
		prefix += "#define " + FloatAttribute.ShininessAlias + "Flag\n";
	if ((mask & FloatAttribute.AlphaTest) == FloatAttribute.AlphaTest)
		prefix += "#define " + FloatAttribute.AlphaTestAlias + "Flag\n";
	if (renderable.bones != null && config.numBones > 0) prefix += "#define numBones " + config.numBones + "\n";
	return prefix;
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:71,代碼來源:DefaultShader.java


注:本文中的com.badlogic.gdx.graphics.VertexAttributes.Usage.BoneWeight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。