Skip to content

Commit

Permalink
Remove GeometryPipeline.computeBinormalAndTangent for 1.31
Browse files Browse the repository at this point in the history
  • Loading branch information
shehzan10 committed Mar 1, 2017
1 parent 961911c commit 9dd1380
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 67 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Change Log
* Breaking changes
* Corrected spelling of `Color.FUCHSIA` from `Color.FUSCHIA`. [#4977](https://github.com/AnalyticalGraphicsInc/cesium/pull/4977)
* The enums `MIDDLE_DOUBLE_CLICK` and `RIGHT_DOUBLE_CLICK` from `ScreenSpaceEventType` have been removed. [#5052](https://github.com/AnalyticalGraphicsInc/cesium/pull/5052)
* Removed the function `GeometryPipeline.computeBinormalAndTangent`. Use `GeometryPipeline.computeTangentAndBitangent`. [#5053](https://github.com/AnalyticalGraphicsInc/cesium/pull/5053)
* Added support to `DebugCameraPrimitive` to draw multifrustum planes. The attribute `debugShowFrustumPlanes` of `Scene` and `frustumPlanes` of `CesiumInspector` toggles this. `FrameState` has been augmented to include `frustumSplits` which is a `Number[]` of the near/far planes of the camera frustums.
* Enable rendering `GroundPrimitives` on hardware without the `EXT_frag_depth` extension; however, this could cause artifacts for certain viewing angles.
* Always outline KML line extrusions so that they show up properly in 2D and other straight down views.
Expand Down
28 changes: 0 additions & 28 deletions Source/Core/GeometryPipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -1352,34 +1352,6 @@ define([
return geometry;
};

/**
* Computes per-vertex binormal and tangents for a geometry containing <code>TRIANGLES</code>.
* The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry.
* This assumes a counter-clockwise winding order.
* <p>
* Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors
* for an Arbitrary Mesh</a> by Eric Lengyel.
* </p>
*
* @param {Geometry} geometry The geometry to modify.
* @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes.
*
* @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3.
* @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}.
*
* @example
* Cesium.GeometryPipeline.computeBinormalAndTangent(geometry);
*
* @see GeometryPipeline.computeTangentAndBitangent
*/
GeometryPipeline.computeBinormalAndTangent = function(geometry) {
deprecationWarning('computeBinormalAndTangent', 'computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent.');
GeometryPipeline.computeTangentAndBitangent(geometry);
geometry.attributes.binormal = geometry.attributes.bitangent;

return geometry;
};

var scratchCartesian2 = new Cartesian2();
var toEncode1 = new Cartesian3();
var toEncode2 = new Cartesian3();
Expand Down
39 changes: 0 additions & 39 deletions Specs/Core/GeometryPipelineSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1712,45 +1712,6 @@ defineSuite([
}
});

it ('computeBinormalAndTangent computes tangent and binormal for BoxGeometry', function() {
// This test is for the deprecated computeBinormalAndTangent API
// It tests to assert that the binormal attribute is set correctly and
// is a copy of the bitangent attribute
var geometry = BoxGeometry.createGeometry(new BoxGeometry({
vertexFormat : new VertexFormat({
position : true,
normal : true,
st : true
}),
maximum : new Cartesian3(250000.0, 250000.0, 250000.0),
minimum : new Cartesian3(-250000.0, -250000.0, -250000.0)
}));
geometry = GeometryPipeline.computeBinormalAndTangent(geometry);
var actualTangents = geometry.attributes.tangent.values;
var actualBinormals = geometry.attributes.binormal.values;

var expectedGeometry = BoxGeometry.createGeometry(new BoxGeometry({
vertexFormat: VertexFormat.ALL,
maximum : new Cartesian3(250000.0, 250000.0, 250000.0),
minimum : new Cartesian3(-250000.0, -250000.0, -250000.0)
}));
var expectedTangents = expectedGeometry.attributes.tangent.values;
var expectedBitangents = expectedGeometry.attributes.bitangent.values;

expect(actualTangents.length).toEqual(expectedTangents.length);
expect(actualBinormals.length).toEqual(expectedBitangents.length);

for (var i = 0; i < actualTangents.length; i += 3) {
var actual = Cartesian3.fromArray(actualTangents, i);
var expected = Cartesian3.fromArray(expectedTangents, i);
expect(actual).toEqualEpsilon(expected, CesiumMath.EPSILON1);

actual = Cartesian3.fromArray(actualBinormals, i);
expected = Cartesian3.fromArray(expectedBitangents, i);
expect(actual).toEqualEpsilon(expected, CesiumMath.EPSILON1);
}
});

it('compressVertices throws without geometry', function() {
expect(function() {
return GeometryPipeline.compressVertices();
Expand Down

0 comments on commit 9dd1380

Please sign in to comment.