Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: utils/matrix/float32.dart

Issue 8872007: beginning of matrix class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review comments Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | utils/matrix/matrix4.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 /**
6 * Emulates the browser's Float32Array (so Matrix4 can be used outside
7 * the browser.
8 * (Note this stores entries as 64-bit doubles, since there is no
9 * 32-bit float type on the vm.)
10 */
11 class Float32Array {
12 final List<double> buf;
13
14 Float32Array(int size) : buf = new List<double>(size) {
15 for (int i = 0; i < size; i++) {
16 buf[i] = 0.0;
17 }
18 }
19
20 double operator [](int i) {
21 return buf[i];
22 }
23
24 void operator []=(int i, num value) {
25 buf[i] = (value != null) ? value.toDouble() : 0.0;
26 }
27 }
OLDNEW
« no previous file with comments | « no previous file | utils/matrix/matrix4.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698