Skip to content

Commit 3f90183

Browse files
committed
fix text texture regression; change TextureInfo default for minFilter; remove setMaterialParams methods in both Shape and ShapeGroup; etc.
1 parent a45adb3 commit 3f90183

21 files changed

+523
-16653
lines changed

demos/picking2.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@
8585
shape.setQuaternion(
8686
H3DU.Math.quatFromTaitBryan(rotation));
8787
if(shape === pickedShape) {
88-
shape.setMaterialParams({"emission":[0.5, 0.5, 0.5]});
88+
shape.getMaterial().setParams({"emission":[0.5, 0.5, 0.5]});
8989
} else {
90-
shape.setMaterialParams({"emission":[0, 0, 0]});
90+
shape.getMaterial().setParams({"emission":[0, 0, 0]});
9191
}
9292
}
9393
rotation[0] = 360 * H3DU.getTimePosition(timer, time, 6000);

demos/picking3.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@
9292
shape.setQuaternion(
9393
H3DU.Math.quatFromTaitBryan(rotation));
9494
if(shape === pickedShape) {
95-
shape.setMaterialParams({"emission":[0.5, 0.5, 0.5]});
95+
shape.getMaterial().setParams({"emission":[0.5, 0.5, 0.5]});
9696
} else {
97-
shape.setMaterialParams({"emission":[0, 0, 0]});
97+
shape.getMaterial().setParams({"emission":[0, 0, 0]});
9898
}
9999
}
100100
rotation[0] = 360 * H3DU.getTimePosition(timer, time, 6000);

demos/selfpulse.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
0
5454
);
5555
shape.setQuaternion(q);
56-
shape.setMaterialParams({"emission":[emissive, emissive, emissive]});
56+
shape.getMaterial().setParams({"emission":[emissive, emissive, emissive]});
5757
// Render the scene
5858
scene.render(sub);
5959
});

demos/specular.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@
4242
], scene).then(function(tex) {
4343
"use strict";
4444
var mesh = H3DU.Meshes.createBox(10, 20, 20);
45-
var shape = new H3DU.Shape(mesh).setMaterialParams({
46-
"diffuse":"white",
47-
"specular":"white",
48-
"shininess":20,
49-
"texture":tex[0],
50-
"specularMap":tex[1]
51-
});
45+
var shape = new H3DU.Shape(mesh).setMaterial(
46+
new H3DU.Material({
47+
"diffuse":"white",
48+
"specular":"white",
49+
"shininess":20,
50+
"texture":tex[0],
51+
"specularMap":tex[1]
52+
}));
5253
sub.addShape(shape);
5354
// Create a timer
5455
var timer = {};

doc/H3DU.Shape.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ the <a href="H3DU.Math.md#H3DU.Math.colorTosRGB">sRGB color space</a>.
3131
* [primitiveCount](#H3DU.Shape_H3DU.Shape_primitiveCount)<br>Gets the number of primitives (triangles, lines,
3232
and points) composed by all shapes in this scene.
3333
* [setColor](#H3DU.Shape_H3DU.Shape_setColor)<br>Sets material parameters that give the shape a certain color.
34-
* [setMaterial](#H3DU.Shape_H3DU.Shape_setMaterial)<br>Sets this shape's material parameters.
35-
* [setMaterialParams](#H3DU.Shape_H3DU.Shape_setMaterialParams)<br>Sets parameters of this shape's material.
34+
* [setMaterial](#H3DU.Shape_H3DU.Shape_setMaterial)<br>Sets this shape's material parameter object.
3635
* [setPosition](#H3DU.Shape_H3DU.Shape_setPosition)<br>Sets the relative position of this shape from its original
3736
position.
3837
* [setQuaternion](#H3DU.Shape_H3DU.Shape_setQuaternion)<br>Sets this object's rotation in the form of a <a href="tutorial-glmath.md">quaternion</a>.
@@ -165,26 +164,12 @@ This object. (Type: <a href="H3DU.Shape.md">H3DU.Shape</a>)
165164
<a name='H3DU.Shape_H3DU.Shape_setMaterial'></a>
166165
### H3DU.Shape#setMaterial(material)
167166

168-
Sets this shape's material parameters.
167+
Sets this shape's material parameter object.
169168

170169
#### Parameters
171170

172171
* `material` (Type: <a href="H3DU.Material.md">H3DU.Material</a> | <a href="H3DU.PbrMaterial.md">H3DU.PbrMaterial</a>)<br>
173-
The material object to use. This parameter can't be a <a href="H3DU.Texture.md">H3DU.Texture</a> object.
174-
175-
#### Return Value
176-
177-
This object. (Type: <a href="H3DU.Shape.md">H3DU.Shape</a>)
178-
179-
<a name='H3DU.Shape_H3DU.Shape_setMaterialParams'></a>
180-
### H3DU.Shape#setMaterialParams(params)
181-
182-
Sets parameters of this shape's material.
183-
184-
#### Parameters
185-
186-
* `params` (Type: Object)<br>
187-
An object described in H3DU.PbrMaterial#setParams.
172+
The material object to use. Throws an error if this parameter is null, is omitted, or is a <a href="H3DU.Texture.md">H3DU.Texture</a> object
188173

189174
#### Return Value
190175

doc/H3DU.ShapeGroup.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ in this shape group at the given index.
3232
and points) composed by all shapes in this shape group.
3333
* [removeShape](#H3DU.ShapeGroup_H3DU.ShapeGroup_removeShape)<br>Removes all instances of a 3D shape from this shape group
3434
* [setMaterial](#H3DU.ShapeGroup_H3DU.ShapeGroup_setMaterial)<br>Sets the material used by all shapes in this shape group.
35-
* [setMaterialParams](#H3DU.ShapeGroup_H3DU.ShapeGroup_setMaterialParams)<br>Sets material parameters for all shapes in this shape group.
3635
* [setPosition](#H3DU.ShapeGroup_H3DU.ShapeGroup_setPosition)<br>Sets the relative position of the shapes in this group
3736
from their original position.
3837
* [setQuaternion](#H3DU.ShapeGroup_H3DU.ShapeGroup_setQuaternion)<br>Sets this shape group's rotation in the form of a <a href="tutorial-glmath.md">quaternion</a>.
@@ -189,20 +188,6 @@ Sets the material used by all shapes in this shape group.
189188

190189
Return value. (Type: Object)
191190

192-
<a name='H3DU.ShapeGroup_H3DU.ShapeGroup_setMaterialParams'></a>
193-
### H3DU.ShapeGroup#setMaterialParams(params)
194-
195-
Sets material parameters for all shapes in this shape group.
196-
197-
#### Parameters
198-
199-
* `params` (Type: Object)<br>
200-
An object described in H3DU.Material#setParams.
201-
202-
#### Return Value
203-
204-
This object. (Type: <a href="H3DU.Shape.md">H3DU.Shape</a>)
205-
206191
<a name='H3DU.ShapeGroup_H3DU.ShapeGroup_setPosition'></a>
207192
### H3DU.ShapeGroup#setPosition(x, y, z)
208193

0 commit comments

Comments
 (0)