125static VuoLayer VuoLayer_makeWithShadowInternal(
VuoText name,
VuoImage image, VuoPoint2d center,
VuoReal rotation,
VuoReal width,
VuoReal alpha,
VuoBoolean preservePhysicalSize,
VuoColor shadowColor,
VuoReal shadowBlur,
VuoReal shadowAngle,
VuoReal shadowDistance,
VuoBoolean isRealSize)
134 float rotationInRadians = rotation * M_PI/180.;
141 VuoPoint2d layerCenter =
VuoPoint2d_make(layerCenter3d.x, layerCenter3d.y);
142 VuoLayer layer =
VuoLayer_make(name, image, layerCenter, rotation, width, VuoOrientation_Horizontal, alpha);
157 float shadowAngleInRadians = shadowAngle * M_PI/180.;
158 VuoPoint3d shadowOffset3d =
VuoPoint3d_make(shadowDistance * cos(shadowAngleInRadians),
159 shadowDistance * sin(shadowAngleInRadians),
162 VuoPoint2d shadowCenter =
VuoPoint2d_make(shadowCenter3d.x, shadowCenter3d.y);
163 VuoReal shadowWidth = width * blurredImage->pixelsWide/image->pixelsWide;
164 VuoLayer shadow =
VuoLayer_make(NULL, blurredImage, shadowCenter, rotation, shadowWidth, VuoOrientation_Horizontal, alpha);
472 if (viewportWidth > 0)
480 b.center.x += anchorOffset.x * b.size.x;
481 b.center.y += anchorOffset.y * b.size.y;
504 VuoPoint2d mesh0 = (VuoPoint2d){ positions[0], positions[1] };
505 VuoTransform_getBillboardMatrix(image->pixelsWide, image->pixelsHigh, image->scaleFactor,
VuoSceneObject_shouldPreservePhysicalSize(so),
VuoSceneObject_getTranslation(so).x,
VuoSceneObject_getTranslation(so).y, viewportWidth, viewportHeight, backingScaleFactor, mesh0, matrix);
519 for (
unsigned long i = 1; i <= childObjectCount; ++i)
524 if (!isnan(childBoundingBox.center.x))
526 if (!isnan(b.center.x))
529 b = childBoundingBox;
556 VuoPoint3d childTranslation = childTransform.translation;
557 VuoPoint2d boundsCenter = rect.center;
558 VuoPoint3d parentTranslation =
VuoPoint3d_make(childTranslation.x - boundsCenter.x, childTranslation.y - boundsCenter.y, 0);
561 boundsCenter.x += rect.size.x * .5f;
563 boundsCenter.x -= rect.size.x * .5f;
566 boundsCenter.y -= rect.size.y * .5f;
568 boundsCenter.y += rect.size.y * .5f;
573 parentTransform.translation = parentTranslation;