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); }
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; }
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); }
Vector3 PhysXD6Joint::getDriveAngularVelocity() const { PxVec3 linear; PxVec3 angular; getInternal()->getDriveVelocity(linear, angular); return fromPxVector(angular); }
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); }
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); }
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); }
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; }
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; }
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; }
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); }
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; }
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; }
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); }
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); }
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; }
PassRefPtr<IDBRequest> IDBIndex::getKey(ExecutionContext* context, const ScriptValue& key, ExceptionState& exceptionState) { IDB_TRACE("IDBIndex::getKey"); return getInternal(context, key, exceptionState, true); }
IDBRequest* IDBIndex::getKey(ScriptState* scriptState, const ScriptValue& key, ExceptionState& exceptionState) { IDB_TRACE("IDBIndex::getKey"); return getInternal(scriptState, key, exceptionState, true); }
bool Dictionary::get(const StringView& key, v8::Local<v8::Value>& value) const { if (!m_isolate) return false; return getInternal(v8String(m_isolate, key), value); }
xWindow::xWindow(xWidget* parent,xLayoutManager* layout,xWindowInternal* i) : xContainer(parent,layout,i) {m_internal = static_cast<xWindowInternal*>(getInternal());}
void PhysXHingeJoint::setFlag(Flag flag, bool enabled) { getInternal()->setRevoluteJointFlag(toPxFlag(flag), enabled); }
bool PhysXHingeJoint::hasFlag(Flag flag) const { return getInternal()->getRevoluteJointFlags() & toPxFlag(flag); }
Radian PhysXHingeJoint::getAngle() const { return Radian(getInternal()->getAngle()); }
float PhysXHingeJoint::getSpeed() const { return getInternal()->getVelocity(); }