void PhysXHingeJoint::setDrive(const Drive& drive)
	{
		getInternal()->setDriveVelocity(drive.speed);
		getInternal()->setDriveForceLimit(drive.forceLimit);
		getInternal()->setDriveGearRatio(drive.gearRatio);
		getInternal()->setRevoluteJointFlag(PxRevoluteJointFlag::eDRIVE_FREESPIN, drive.freeSpin);
	}
Esempio n. 2
0
bool ResourceHandle::start(Frame* frame)
{
    if (!frame)
        return false;

    Page *page = frame->page();
    // If we are no longer attached to a Page, this must be an attempted load from an
    // onUnload handler, so let's just block it.
    if (!page)
        return false;

    if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) {
        // If credentials were specified for this request, add them to the url,
        // so that they will be passed to QNetworkRequest.
        KURL urlWithCredentials(d->m_request.url());
        urlWithCredentials.setUser(d->m_user);
        urlWithCredentials.setPass(d->m_pass);
        d->m_request.setURL(urlWithCredentials);
    }

    getInternal()->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
#if QT_VERSION < 0x040400
    return QWebNetworkManager::self()->add(this, getInternal()->m_frame->page()->d->networkInterface);
#else
    ResourceHandleInternal *d = getInternal();
    d->m_job = new QNetworkReplyHandler(this, QNetworkReplyHandler::LoadMode(d->m_defersLoading));
    return true;
#endif
}
void ResourceHandle::setCookies()
{
    CookieManager* manager = CookieManager::getCookieManager();
    KURL url = getInternal()->m_response.url();

    if (manager)
        manager->setCookies(url, KURL(), getInternal()->m_response.httpHeaderField("Set-Cookie"));

    checkAndSendCookies(url);
}
	PhysXHingeJoint::Drive PhysXHingeJoint::getDrive() const
	{
		Drive drive;
		drive.speed = getInternal()->getDriveVelocity();
		drive.forceLimit = getInternal()->getDriveForceLimit();
		drive.gearRatio = getInternal()->getDriveGearRatio();
		drive.freeSpin = getInternal()->getRevoluteJointFlags() & PxRevoluteJointFlag::eDRIVE_FREESPIN;

		return drive;
	}
Esempio n. 5
0
void ResourceHandle::setCookies()
{
    KURL url = getInternal()->m_request.url();
    if ((cookieManager().cookiePolicy() == CookieStorageAcceptPolicyOnlyFromMainDocumentDomain) 
      && (getInternal()->m_request.firstPartyForCookies() != url)
      && cookieManager().getCookie(url, WithHttpOnlyCookies).isEmpty())
        return;
    cookieManager().setCookies(url, getInternal()->m_response.httpHeaderField("Set-Cookie"));
    checkAndSendCookies(url);
}
	void PhysXMeshCollider::setGeometry(const PxGeometry& geometry)
	{
		PxShape* shape = getInternal()->_getShape();
		if (shape->getGeometryType() != geometry.getType())
		{
			PxShape* newShape = gPhysX().getPhysX()->createShape(geometry, *gPhysX().getDefaultMaterial(), true);
			getInternal()->_setShape(newShape);
		}
		else
			getInternal()->_getShape()->setGeometry(geometry);
	}
	void PhysXBoxCollider::applyGeometry()
	{
		PxBoxGeometry geometry(std::max(0.01f, mExtents.x * mScale.x), 
			std::max(0.01f, mExtents.y * mScale.y), std::max(0.01f, mExtents.z * mScale.z));

		getInternal()->_getShape()->setGeometry(geometry);
	}
	void PhysXSphereCollider::applyGeometry()
	{
		float radius = std::max(0.01f, mRadius * std::max(std::max(mScale.x, mScale.y), mScale.z));
		PxSphereGeometry geometry(radius);

		getInternal()->_getShape()->setGeometry(geometry);
	}
Esempio n. 9
0
	Vector3 PhysXD6Joint::getDriveAngularVelocity() const
	{
		PxVec3 linear;
		PxVec3 angular;

		getInternal()->getDriveVelocity(linear, angular);
		return fromPxVector(angular);
	}
Esempio n. 10
0
	void PhysXD6Joint::setLimitLinear(const LimitLinear& limit)
	{
		PxJointLinearLimit pxLimit(gPhysX().getScale(), limit.extent, limit.contactDist);
		pxLimit.stiffness = limit.spring.stiffness;
		pxLimit.damping = limit.spring.damping;
		pxLimit.restitution = limit.restitution;

		getInternal()->setLinearLimit(pxLimit);
	}
Esempio n. 11
0
	void PhysXHingeJoint::setLimit(const LimitAngularRange& limit)
	{
		PxJointAngularLimitPair pxLimit(limit.lower.valueRadians(), limit.upper.valueRadians(), limit.contactDist);
		pxLimit.stiffness = limit.spring.stiffness;
		pxLimit.damping = limit.spring.damping;
		pxLimit.restitution = limit.restitution;

		getInternal()->setLimit(pxLimit);
	}
Esempio n. 12
0
	void PhysXD6Joint::setLimitSwing(const LimitConeRange& limit)
	{
		PxJointLimitCone pxLimit(limit.yLimitAngle.valueRadians(), limit.zLimitAngle.valueRadians(), limit.contactDist);
		pxLimit.stiffness = limit.spring.stiffness;
		pxLimit.damping = limit.spring.damping;
		pxLimit.restitution = limit.restitution;

		getInternal()->setSwingLimit(pxLimit);
	}
Esempio n. 13
0
bool ResourceHandle::start(Frame* frame)
{
    if (!frame)
        return false;

    Page *page = frame->page();
    // If we are no longer attached to a Page, this must be an attempted load from an
    // onUnload handler, so let's just block it.
    if (!page)
        return false;

    getInternal()->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
#if QT_VERSION < 0x040400
    return QWebNetworkManager::self()->add(this, getInternal()->m_frame->page()->d->networkInterface);
#else
    ResourceHandleInternal *d = getInternal();
    d->m_job = new QNetworkReplyHandler(this);
    return true;
#endif
}
bool ResourceHandle::start(NetworkingContext* context)
{
    // If NetworkingContext is invalid then we are no longer attached to a Page,
    // this must be an attempted load from an unload event handler, so let's just block it.
    if (context && !context->isValid())
        return false;

    if (!d->m_user.isEmpty() || !d->m_pass.isEmpty()) {
        // If credentials were specified for this request, add them to the url,
        // so that they will be passed to QNetworkRequest.
        KURL urlWithCredentials(firstRequest().url());
        urlWithCredentials.setUser(d->m_user);
        urlWithCredentials.setPass(d->m_pass);
        d->m_firstRequest.setURL(urlWithCredentials);
    }

    getInternal()->m_context = context;
    ResourceHandleInternal *d = getInternal();
    d->m_job = new QNetworkReplyHandler(this, QNetworkReplyHandler::AsynchronousLoad, d->m_defersLoading);
    return true;
}
Esempio n. 15
0
	D6JointDrive PhysXD6Joint::getDrive(D6JointDriveType type) const
	{
		PxD6JointDrive pxDrive = getInternal()->getDrive(toPxDrive(type));

		D6JointDrive drive;
		drive.acceleration = pxDrive.flags & PxD6JointDriveFlag::eACCELERATION;
		drive.stiffness = pxDrive.stiffness;
		drive.damping = pxDrive.damping;
		drive.forceLimit = pxDrive.forceLimit;

		return drive;
	}
Esempio n. 16
0
	LimitLinear PhysXD6Joint::getLimitLinear() const
	{
		PxJointLinearLimit pxLimit = getInternal()->getLinearLimit();

		LimitLinear limit;
		limit.extent = pxLimit.value;
		limit.contactDist = pxLimit.contactDistance;
		limit.restitution = pxLimit.restitution;
		limit.spring.stiffness = pxLimit.stiffness;
		limit.spring.damping = pxLimit.damping;

		return limit;
	}
Esempio n. 17
0
	void PhysXD6Joint::setDrive(D6JointDriveType type, const D6JointDrive& drive)
	{
		PxD6JointDrive pxDrive;

		if(drive.acceleration)
			pxDrive.flags = PxD6JointDriveFlag::eACCELERATION;

		pxDrive.stiffness = drive.stiffness;
		pxDrive.damping = drive.damping;
		pxDrive.forceLimit = drive.forceLimit;

		getInternal()->setDrive(toPxDrive(type), pxDrive);
	}
Esempio n. 18
0
	LimitConeRange PhysXD6Joint::getLimitSwing() const
	{
		PxJointLimitCone pxLimit = getInternal()->getSwingLimit();

		LimitConeRange limit;
		limit.yLimitAngle = pxLimit.yAngle;
		limit.zLimitAngle = pxLimit.zAngle;
		limit.contactDist = pxLimit.contactDistance;
		limit.restitution = pxLimit.restitution;
		limit.spring.stiffness = pxLimit.stiffness;
		limit.spring.damping = pxLimit.damping;

		return limit;
	}
Esempio n. 19
0
	LimitAngularRange PhysXHingeJoint::getLimit() const
	{
		PxJointAngularLimitPair pxLimit = getInternal()->getLimit();

		LimitAngularRange limit;
		limit.lower = pxLimit.lower;
		limit.upper = pxLimit.upper;
		limit.contactDist = pxLimit.contactDistance;
		limit.restitution = pxLimit.restitution;
		limit.spring.stiffness = pxLimit.stiffness;
		limit.spring.damping = pxLimit.damping;

		return limit;
	}
Esempio n. 20
0
DictionaryIterator Dictionary::getIterator(
    ExecutionContext* executionContext) const {
  v8::Local<v8::Value> iteratorGetter;
  if (!getInternal(v8::Symbol::GetIterator(m_isolate), iteratorGetter) ||
      !iteratorGetter->IsFunction())
    return nullptr;
  v8::Local<v8::Value> iterator;
  if (!v8Call(V8ScriptRunner::callFunction(
                  v8::Local<v8::Function>::Cast(iteratorGetter),
                  executionContext, m_dictionaryObject, 0, nullptr, m_isolate),
              iterator))
    return nullptr;
  if (!iterator->IsObject())
    return nullptr;
  return DictionaryIterator(v8::Local<v8::Object>::Cast(iterator), m_isolate);
}
Esempio n. 21
0
DictionaryIterator Dictionary::getIterator(
    ExecutionContext* executionContext) const {
  v8::Local<v8::Value> iteratorGetter;
  // TODO(alancutter): Support callable objects as well as functions.
  if (!getInternal(v8::Symbol::GetIterator(m_isolate), iteratorGetter) ||
      !iteratorGetter->IsFunction())
    return nullptr;
  v8::Local<v8::Value> iterator;
  if (!v8Call(V8ScriptRunner::callFunction(
                  v8::Local<v8::Function>::Cast(iteratorGetter),
                  executionContext, m_options, 0, nullptr, m_isolate),
              iterator))
    return nullptr;
  if (!iterator->IsObject())
    return nullptr;
  return DictionaryIterator(v8::Local<v8::Object>::Cast(iterator), m_isolate);
}
Esempio n. 22
0
std::vector<std::string> KVStore::getInternal(const std::string& key, std::vector<std::string>*)
{
    Transaction transaction(*this);

    unsigned int valuesSize = get<unsigned int>(key);
    std::vector<std::string> values(valuesSize);
    if (valuesSize == 0) {
        transaction.commit();
        return values;
    }

    for (unsigned int i = 0; i < values.size(); ++i) {
        values[i] = getInternal(config::key(key, std::to_string(i)),
                                static_cast<std::string*>(nullptr));

    }

    transaction.commit();
    return values;
}
Esempio n. 23
0
PassRefPtr<IDBRequest> IDBIndex::getKey(ExecutionContext* context, const ScriptValue& key, ExceptionState& exceptionState)
{
    IDB_TRACE("IDBIndex::getKey");
    return getInternal(context, key, exceptionState, true);
}
Esempio n. 24
0
IDBRequest* IDBIndex::getKey(ScriptState* scriptState, const ScriptValue& key, ExceptionState& exceptionState)
{
    IDB_TRACE("IDBIndex::getKey");
    return getInternal(scriptState, key, exceptionState, true);
}
Esempio n. 25
0
bool Dictionary::get(const StringView& key, v8::Local<v8::Value>& value) const {
  if (!m_isolate)
    return false;
  return getInternal(v8String(m_isolate, key), value);
}
Esempio n. 26
0
xWindow::xWindow(xWidget* parent,xLayoutManager* layout,xWindowInternal* i)
: xContainer(parent,layout,i)
{m_internal = static_cast<xWindowInternal*>(getInternal());}
Esempio n. 27
0
	void PhysXHingeJoint::setFlag(Flag flag, bool enabled)
	{
		getInternal()->setRevoluteJointFlag(toPxFlag(flag), enabled);
	}
Esempio n. 28
0
	bool PhysXHingeJoint::hasFlag(Flag flag) const
	{
		return getInternal()->getRevoluteJointFlags() & toPxFlag(flag);
	}
Esempio n. 29
0
	Radian PhysXHingeJoint::getAngle() const
	{
		return Radian(getInternal()->getAngle());
	}
Esempio n. 30
0
	float PhysXHingeJoint::getSpeed() const
	{
		return getInternal()->getVelocity();
	}