MCPcopy Create free account
hub / github.com/cinder/Cinder / reposition

Method reposition

test/ShapeTest/src/ShapeTestApp.cpp:248–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248void ShapeTestApp::reposition( const vec2 &mouse )
249{
250 // Convert mouse to object space.
251 mat4 invModelMatrix = glm::inverse( mModelMatrix );
252 vec2 anchor = vec2( invModelMatrix * vec4( mouse, 0, 1 ) );
253
254 // Calculate new position, anchor and scale.
255 mPosition += vec2( mModelMatrix * vec4( anchor - mAnchor, 0, 0 ) );
256 mAnchor = anchor;
257}
258
259void ShapeTestApp::calculate()
260{

Callers 4

foundation.min.jsFile · 0.80
path2dpart3.jsFile · 0.80
path2dpart2.jsFile · 0.80
path2dpart1.jsFile · 0.80

Calls 1

inverseFunction · 0.85

Tested by

no test coverage detected