use of com.gempukku.libgdx.graph.shader.property.PropertySource in project gdx-graph by MarcinSc.
the class BoneWeightPropertyProducer method createProperty.
@Override
public PropertySource createProperty(int index, String name, JsonValue data, PropertyLocation location, boolean designTime) {
int boneWeightCount = data.getInt("maxBoneWeightCount", 4);
Vector2[] defaultValue = new Vector2[boneWeightCount];
for (int i = 0; i < boneWeightCount; i++) {
defaultValue[i] = new Vector2(0, 1);
}
return new PropertySource(index, name, new BoneWeightFieldType(boneWeightCount), location, defaultValue);
}
use of com.gempukku.libgdx.graph.shader.property.PropertySource in project gdx-graph by MarcinSc.
the class QuadParticleModel method updateParticleData.
@Override
public void updateParticleData(float[] particlesData, int particleOffset, VertexAttributes vertexAttributes, ObjectMap<String, String> attributeToPropertyMap, ObjectMap<String, PropertySource> properties, ObjectMap<String, Object> attributes) {
int vertexLength = vertexAttributes.vertexSize / 4;
for (VertexAttribute vertexAttribute : vertexAttributes) {
String propertyName = attributeToPropertyMap.get(vertexAttribute.alias);
if (propertyName != null) {
int attributeOffset = vertexAttribute.offset / 4;
PropertySource propertySource = properties.get(propertyName);
Object attributeValue = attributes.get(propertyName);
ParticlesUtil.setParticleAttribute(particlesData, particleOffset, VERTEX_COUNT, vertexLength, attributeOffset, propertySource, attributeValue);
}
}
}
Aggregations