Rich Eakin
2015-06-14 07:25:20 UTC
I'm trying to get the following routine to construct a (dart)
vector_math:Vector3 from a (c++) glm::vec3 so I can pass it into my dart
script, but I can't seem to get the vector_math::Vector3 type.
Dart_Handle toDart( const glm::vec3 &value )
{
Dart_Handle vecArgs[3] = { Dart_NewDouble( value.x ), Dart_NewDouble(
value.y ), Dart_NewDouble( value.z ) };
Dart_Handle vectorMathLib = Dart_LookupLibrary( toDart( "vector_math" ) );
CIDART_CHECK( vectorMathLib ); // *<-- error: "library 'vector_math' not
found."*
Dart_Handle typeHandle = Dart_GetType( vectorMathLib, toDart( "Vector3" ),
3, vecArgs );
CIDART_CHECK( typeHandle );
Dart_Handle result = Dart_New( typeHandle, Dart_Null(), 3, vecArgs );
CIDART_CHECK( result );
return result;
}
The current script / isolate being run has already imported vector_math
with the line:
import 'package:vector_math/vector_math.dart';
Does anyone know how I can make this work? Do I need to Dart_LoadLibrary()
on vector_math for a second time? I'm missing something, just not sure
what.
Thanks for any help,
Rich
vector_math:Vector3 from a (c++) glm::vec3 so I can pass it into my dart
script, but I can't seem to get the vector_math::Vector3 type.
Dart_Handle toDart( const glm::vec3 &value )
{
Dart_Handle vecArgs[3] = { Dart_NewDouble( value.x ), Dart_NewDouble(
value.y ), Dart_NewDouble( value.z ) };
Dart_Handle vectorMathLib = Dart_LookupLibrary( toDart( "vector_math" ) );
CIDART_CHECK( vectorMathLib ); // *<-- error: "library 'vector_math' not
found."*
Dart_Handle typeHandle = Dart_GetType( vectorMathLib, toDart( "Vector3" ),
3, vecArgs );
CIDART_CHECK( typeHandle );
Dart_Handle result = Dart_New( typeHandle, Dart_Null(), 3, vecArgs );
CIDART_CHECK( result );
return result;
}
The current script / isolate being run has already imported vector_math
with the line:
import 'package:vector_math/vector_math.dart';
Does anyone know how I can make this work? Do I need to Dart_LoadLibrary()
on vector_math for a second time? I'm missing something, just not sure
what.
Thanks for any help,
Rich
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.