Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove GeometryPipeline.computeBinormalAndTangent for 1.31 #5053

Merged
merged 1 commit into from
Mar 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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