Пример #1
0
sfTransform sfText_getInverseTransform(const sfText* text)
{
    CSFML_CHECK_RETURN(text, sfTransform_Identity);

    text->InverseTransform = convertTransform(text->This.getInverseTransform());
    return text->InverseTransform;
}
InterpolationValue CSSTransformInterpolationType::maybeConvertValue(
    const CSSValue& value,
    const StyleResolverState& state,
    ConversionCheckers& conversionCheckers) const {
  if (value.isValueList()) {
    CSSLengthArray lengthArray;
    for (const CSSValue* item : toCSSValueList(value)) {
      const CSSFunctionValue& transformFunction = toCSSFunctionValue(*item);
      if (transformFunction.functionType() == CSSValueMatrix ||
          transformFunction.functionType() == CSSValueMatrix3d) {
        lengthArray.typeFlags.set(CSSPrimitiveValue::UnitTypePixels);
        continue;
      }
      for (const CSSValue* argument : transformFunction) {
        const CSSPrimitiveValue& primitiveValue =
            toCSSPrimitiveValue(*argument);
        if (!primitiveValue.isLength())
          continue;
        primitiveValue.accumulateLengthArray(lengthArray);
      }
    }
    std::unique_ptr<InterpolationType::ConversionChecker> lengthUnitsChecker =
        LengthUnitsChecker::maybeCreate(std::move(lengthArray), state);

    if (lengthUnitsChecker)
      conversionCheckers.append(std::move(lengthUnitsChecker));
  }

  TransformOperations transform;
  TransformBuilder::createTransformOperations(
      value, state.cssToLengthConversionData(), transform);
  return convertTransform(std::move(transform));
}
Пример #3
0
sfTransform sfCircleShape_getInverseTransform(const sfCircleShape* shape)
{
    CSFML_CHECK_RETURN(shape, sfTransform_Identity);

    shape->InverseTransform = convertTransform(shape->This.getInverseTransform());
    return shape->InverseTransform;
}
InterpolationValue CSSTransformInterpolationType::maybeConvertInherit(
    const StyleResolverState& state,
    ConversionCheckers& conversionCheckers) const {
  const TransformOperations& inheritedTransform =
      state.parentStyle()->transform();
  conversionCheckers.append(
      InheritedTransformChecker::create(inheritedTransform));
  return convertTransform(inheritedTransform);
}
Пример #5
0
//==============================================================================
void BulletCollisionNode::updateBulletCollisionObjects()
{
  for (int i = 0; i < mbtCollsionObjects.size(); ++i)
  {
    BulletUserData* userData =
        static_cast<BulletUserData*>(mbtCollsionObjects[i]->getUserPointer());
    dynamics::Shape* shape = userData->shape;
    btTransform T = convertTransform(mBodyNode->getWorldTransform() *
                                     shape->getLocalTransform());
    mbtCollsionObjects[i]->setWorldTransform(T);
  }
}
Пример #6
0
////////////////////////////////////////////////////////////
// Convert sfRenderStates* to sf::RenderStates
////////////////////////////////////////////////////////////
inline sf::RenderStates convertRenderStates(const sfRenderStates* states)
{
    sf::RenderStates sfmlStates;

    if (states)
    {
        sfmlStates.blendMode = static_cast<sf::BlendMode>(states->blendMode);
        sfmlStates.transform = convertTransform(states->transform);
        sfmlStates.texture = states->texture ? states->texture->This : NULL;
        sfmlStates.shader = states->shader ? &states->shader->This : NULL;
    }

    return sfmlStates;
}
InterpolationValue CSSTransformInterpolationType::maybeConvertUnderlyingValue(
    const InterpolationEnvironment& environment) const {
  return convertTransform(environment.state().style()->transform());
}
InterpolationValue CSSTransformInterpolationType::maybeConvertInitial(
    const StyleResolverState&,
    ConversionCheckers&) const {
  return convertTransform(ComputedStyle::initialStyle().transform());
}
InterpolationValue CSSTransformInterpolationType::maybeConvertNeutral(
    const InterpolationValue& underlying,
    ConversionCheckers&) const {
  return convertTransform(EmptyTransformOperations());
}
Пример #10
0
//==============================================================================
void BulletCollisionObject::updateEngineData()
{
  mBulletCollisionObject->setWorldTransform(
      convertTransform(mShapeFrame->getWorldTransform()));
}
Пример #11
0
void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform)
{
	CSFML_CALL(shader, setParameter(name, convertTransform(transform)));
}