Daily Archives

Articles indexed Friday November 9 2012

Page 4/19 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Gnome 3 not displaying thumbnails?

    - by user70988
    I'm running 12.04 LTS and I can't seem to see any thumbnails for pictures, videos, anything. I have checked my preferences "Show Thumbnails, Always, files under 10MB, Local Only" which makes sense but still, no thumbails. I was having problems with Unity 3D and my nvidia card and I entered a force_unity_start code somewhere. Now I got gnome 3 working (turns out i just had to turn zoom off) I'm still having this problem. please advise if you need any more information to help me with this!

    Read the article

  • Low display resolution under Ubuntu 12.04

    - by Chinouk
    I had some problem after installing new drivers for Nvidia. After having followed the instructions answered to this question, I now only have the Nouveau open-source driver. I can have access to my desktop, but I'm stuck with a 640x480 (4:3) resolution. No other resolution is proposed in the dropdown list of the "Displays" utility. I tried installing the two Nvidia drivers suggested in the "Additional Drivers" utility, but each one broke my display again. Now that I have reverted back to Nouveau again, what should I do to get a higher resolution ?

    Read the article

  • Why won't Remmina connect to Windows 7 Remote Desktop?

    - by rfc1484
    I'm using Ubuntu and I'm trying to connect to another machine in a different network using remote desktop. In Windows7 I have made the following in order to activate remote desktop: I've gone to computer - properties - remote settings I've selected the option: "Allow connections from computers running any version of Remote Desktop I've opened "Windows Firewall with Advanced Security" In inbound rules I've enabled the rules for remote desktop (public and domain) I have also installed Remmina in the Ubuntu machine. For configuring it I did the following steps: Selected the RDP protocol In the server input I have written the Windows machine public IP. In username / password I have typed my login credentials (the same as my Windows admin account) But when I try to connect I get this error message: "Unable to connect to RDP server 89.130.251.160" If I ping my Windows7 machine, I have a correct response. Any suggestions?

    Read the article

  • How can I find out what site a popup ad came from?

    - by ændrük
    This is the situation: I've been browsing the web for an hour in pursuit of some bit of technical information and have visited several dozen websites that I don't even remember anymore. I've finally found what I need so I start closing the web browser, only to discover that — aaargh! — there's a popup ad hiding underneath! My blood boils. What insidious website is responsible for this circumvention of my browser's popup blocker? I want to make it pay for its crime. I'll write angry emails. Leave bad reviews. Even block it from my Google search results — yes, that'll show it! But I've reached an impediment. The offending site has already been closed. Is it too late to deduce the advertisement's origin? Or can I somehow un-pop the popup? Here's a test page. With only the popup left on your screen, can you deduce that it was caused by visiting PasteHTML?

    Read the article

  • Synchronizing (updating) published files

    - by MucMug
    How can I update a published file and maintain the same URL? After saving an update of a published file on my desktop, it will automatically "synchronise" with the corresponding files at UbuntuOne (and it does). Problem is that the "new file", actually the updated file with the same name, is no longer published. Pressing the publish button results is a new URL. I now have to mail new URL's and change embedded links, as old URL will result in a failure to find the updated file (or indeed any file). I am not sure if it is a bug or a design flaw (maybe intentional?), but it seems strange to me.

    Read the article

  • Can a website become popular in a "category" (ie, not just a single page)

    - by Earlz
    I have a few keywords where my website is high ranking(2nd and 3rd result). For instance, I have 3 blog posts covering a certain kind of modem. Is it common for search engines to consider a website popular in a "category"? For instance, if I was the first result for "foobar" with one page, and then added another separate page which mentioned "foobar"(and maybe a link from the original page), would a search engine prioritize this separate page when compared to a completely separate website with a page with the same content?

    Read the article

  • Website Remodel Redirects

    - by inKit
    We've recently built a site for a new client who has not inserted all the content that they had from their old site into their new one. Also a lot of content is dynamic with ID's not matching from the old site to the new one. We have added dynamic redirects for most of the patterns we could find in pages that were 404ing, but there are still a lot of pages that had content, or just jumbled urls that we cannot match up with content pages on the new site. Is it better to redirect these leftover pages to the homepage? Or leave them 404ing?

    Read the article

  • Hide from google while developing

    - by user210757
    I will be building a (wordpress) web site. While I am developing, other team members will be pushing content. I'd like to have it hidden from google while under development. It will be hosted on godaddy. I have thought of not pointing the domain name to it until live and using "preview dns", or buying a static IP during development. Or hosting dev site in a sub-directory ("/dev/") until ready and then moving it up a level. If in the dev directory I'd add htaccess or robots.txt to not crawl. Is any of this a bad idea? Will google penalize for any of this - like search by IP and then associate that with the domain later on? Any better ideas?

    Read the article

  • Help with Collision Resolution?

    - by Milo
    I'm trying to learn about physics by trying to make a simplified GTA 2 clone. My only problem is collision resolution. Everything else works great. I have a rigid body class and from there cars and a wheel class: class RigidBody extends Entity { //linear private Vector2D velocity = new Vector2D(); private Vector2D forces = new Vector2D(); private OBB2D predictionRect = new OBB2D(new Vector2D(), 1.0f, 1.0f, 0.0f); private float mass; private Vector2D deltaVec = new Vector2D(); private Vector2D v = new Vector2D(); //angular private float angularVelocity; private float torque; private float inertia; //graphical private Vector2D halfSize = new Vector2D(); private Bitmap image; private Matrix mat = new Matrix(); private float[] Vector2Ds = new float[2]; private Vector2D tangent = new Vector2D(); private static Vector2D worldRelVec = new Vector2D(); private static Vector2D relWorldVec = new Vector2D(); private static Vector2D pointVelVec = new Vector2D(); public RigidBody() { //set these defaults so we don't get divide by zeros mass = 1.0f; inertia = 1.0f; setLayer(LAYER_OBJECTS); } protected void rectChanged() { if(getWorld() != null) { getWorld().updateDynamic(this); } } //intialize out parameters public void initialize(Vector2D halfSize, float mass, Bitmap bitmap) { //store physical parameters this.halfSize = halfSize; this.mass = mass; image = bitmap; inertia = (1.0f / 20.0f) * (halfSize.x * halfSize.x) * (halfSize.y * halfSize.y) * mass; RectF rect = new RectF(); float scalar = 10.0f; rect.left = (int)-halfSize.x * scalar; rect.top = (int)-halfSize.y * scalar; rect.right = rect.left + (int)(halfSize.x * 2.0f * scalar); rect.bottom = rect.top + (int)(halfSize.y * 2.0f * scalar); setRect(rect); predictionRect.set(rect); } public void setLocation(Vector2D position, float angle) { getRect().set(position, getWidth(), getHeight(), angle); rectChanged(); } public void setPredictionLocation(Vector2D position, float angle) { getPredictionRect().set(position, getWidth(), getHeight(), angle); } public void setPredictionCenter(Vector2D center) { getPredictionRect().moveTo(center); } public void setPredictionAngle(float angle) { predictionRect.setAngle(angle); } public Vector2D getPosition() { return getRect().getCenter(); } public OBB2D getPredictionRect() { return predictionRect; } @Override public void update(float timeStep) { doUpdate(false,timeStep); } public void doUpdate(boolean prediction, float timeStep) { //integrate physics //linear Vector2D acceleration = Vector2D.scalarDivide(forces, mass); if(prediction) { Vector2D velocity = Vector2D.add(this.velocity, Vector2D.scalarMultiply(acceleration, timeStep)); Vector2D c = getRect().getCenter(); c = Vector2D.add(getRect().getCenter(), Vector2D.scalarMultiply(velocity , timeStep)); setPredictionCenter(c); //forces = new Vector2D(0,0); //clear forces } else { velocity.x += (acceleration.x * timeStep); velocity.y += (acceleration.y * timeStep); //velocity = Vector2D.add(velocity, Vector2D.scalarMultiply(acceleration, timeStep)); Vector2D c = getRect().getCenter(); v.x = getRect().getCenter().getX() + (velocity.x * timeStep); v.y = getRect().getCenter().getY() + (velocity.y * timeStep); deltaVec.x = v.x - c.x; deltaVec.y = v.y - c.y; deltaVec.normalize(); setCenter(v.x, v.y); forces.x = 0; //clear forces forces.y = 0; } //angular float angAcc = torque / inertia; if(prediction) { float angularVelocity = this.angularVelocity + angAcc * timeStep; setPredictionAngle(getAngle() + angularVelocity * timeStep); //torque = 0; //clear torque } else { angularVelocity += angAcc * timeStep; setAngle(getAngle() + angularVelocity * timeStep); torque = 0; //clear torque } } public void updatePrediction(float timeStep) { doUpdate(true, timeStep); } //take a relative Vector2D and make it a world Vector2D public Vector2D relativeToWorld(Vector2D relative) { mat.reset(); Vector2Ds[0] = relative.x; Vector2Ds[1] = relative.y; mat.postRotate(JMath.radToDeg(getAngle())); mat.mapVectors(Vector2Ds); relWorldVec.x = Vector2Ds[0]; relWorldVec.y = Vector2Ds[1]; return new Vector2D(Vector2Ds[0], Vector2Ds[1]); } //take a world Vector2D and make it a relative Vector2D public Vector2D worldToRelative(Vector2D world) { mat.reset(); Vector2Ds[0] = world.x; Vector2Ds[1] = world.y; mat.postRotate(JMath.radToDeg(-getAngle())); mat.mapVectors(Vector2Ds); return new Vector2D(Vector2Ds[0], Vector2Ds[1]); } //velocity of a point on body public Vector2D pointVelocity(Vector2D worldOffset) { tangent.x = -worldOffset.y; tangent.y = worldOffset.x; return Vector2D.add( Vector2D.scalarMultiply(tangent, angularVelocity) , velocity); } public void applyForce(Vector2D worldForce, Vector2D worldOffset) { //add linear force forces.x += worldForce.x; forces.y += worldForce.y; //add associated torque torque += Vector2D.cross(worldOffset, worldForce); } @Override public void draw( GraphicsContext c) { c.drawRotatedScaledBitmap(image, getPosition().x, getPosition().y, getWidth(), getHeight(), getAngle()); } public Vector2D getVelocity() { return velocity; } public void setVelocity(Vector2D velocity) { this.velocity = velocity; } public Vector2D getDeltaVec() { return deltaVec; } } Vehicle public class Wheel { private Vector2D forwardVec; private Vector2D sideVec; private float wheelTorque; private float wheelSpeed; private float wheelInertia; private float wheelRadius; private Vector2D position = new Vector2D(); public Wheel(Vector2D position, float radius) { this.position = position; setSteeringAngle(0); wheelSpeed = 0; wheelRadius = radius; wheelInertia = (radius * radius) * 1.1f; } public void setSteeringAngle(float newAngle) { Matrix mat = new Matrix(); float []vecArray = new float[4]; //forward Vector vecArray[0] = 0; vecArray[1] = 1; //side Vector vecArray[2] = -1; vecArray[3] = 0; mat.postRotate(newAngle / (float)Math.PI * 180.0f); mat.mapVectors(vecArray); forwardVec = new Vector2D(vecArray[0], vecArray[1]); sideVec = new Vector2D(vecArray[2], vecArray[3]); } public void addTransmissionTorque(float newValue) { wheelTorque += newValue; } public float getWheelSpeed() { return wheelSpeed; } public Vector2D getAnchorPoint() { return position; } public Vector2D calculateForce(Vector2D relativeGroundSpeed, float timeStep, boolean prediction) { //calculate speed of tire patch at ground Vector2D patchSpeed = Vector2D.scalarMultiply(Vector2D.scalarMultiply( Vector2D.negative(forwardVec), wheelSpeed), wheelRadius); //get velocity difference between ground and patch Vector2D velDifference = Vector2D.add(relativeGroundSpeed , patchSpeed); //project ground speed onto side axis Float forwardMag = new Float(0.0f); Vector2D sideVel = velDifference.project(sideVec); Vector2D forwardVel = velDifference.project(forwardVec, forwardMag); //calculate super fake friction forces //calculate response force Vector2D responseForce = Vector2D.scalarMultiply(Vector2D.negative(sideVel), 2.0f); responseForce = Vector2D.subtract(responseForce, forwardVel); float topSpeed = 500.0f; //calculate torque on wheel wheelTorque += forwardMag * wheelRadius; //integrate total torque into wheel wheelSpeed += wheelTorque / wheelInertia * timeStep; //top speed limit (kind of a hack) if(wheelSpeed > topSpeed) { wheelSpeed = topSpeed; } //clear our transmission torque accumulator wheelTorque = 0; //return force acting on body return responseForce; } public void setTransmissionTorque(float newValue) { wheelTorque = newValue; } public float getTransmissionTourque() { return wheelTorque; } public void setWheelSpeed(float speed) { wheelSpeed = speed; } } //our vehicle object public class Vehicle extends RigidBody { private Wheel [] wheels = new Wheel[4]; private boolean throttled = false; public void initialize(Vector2D halfSize, float mass, Bitmap bitmap) { //front wheels wheels[0] = new Wheel(new Vector2D(halfSize.x, halfSize.y), 0.45f); wheels[1] = new Wheel(new Vector2D(-halfSize.x, halfSize.y), 0.45f); //rear wheels wheels[2] = new Wheel(new Vector2D(halfSize.x, -halfSize.y), 0.75f); wheels[3] = new Wheel(new Vector2D(-halfSize.x, -halfSize.y), 0.75f); super.initialize(halfSize, mass, bitmap); } public void setSteering(float steering) { float steeringLock = 0.13f; //apply steering angle to front wheels wheels[0].setSteeringAngle(steering * steeringLock); wheels[1].setSteeringAngle(steering * steeringLock); } public void setThrottle(float throttle, boolean allWheel) { float torque = 85.0f; throttled = true; //apply transmission torque to back wheels if (allWheel) { wheels[0].addTransmissionTorque(throttle * torque); wheels[1].addTransmissionTorque(throttle * torque); } wheels[2].addTransmissionTorque(throttle * torque); wheels[3].addTransmissionTorque(throttle * torque); } public void setBrakes(float brakes) { float brakeTorque = 15.0f; //apply brake torque opposing wheel vel for (Wheel wheel : wheels) { float wheelVel = wheel.getWheelSpeed(); wheel.addTransmissionTorque(-wheelVel * brakeTorque * brakes); } } public void doUpdate(float timeStep, boolean prediction) { for (Wheel wheel : wheels) { float wheelVel = wheel.getWheelSpeed(); //apply negative force to naturally slow down car if(!throttled && !prediction) wheel.addTransmissionTorque(-wheelVel * 0.11f); Vector2D worldWheelOffset = relativeToWorld(wheel.getAnchorPoint()); Vector2D worldGroundVel = pointVelocity(worldWheelOffset); Vector2D relativeGroundSpeed = worldToRelative(worldGroundVel); Vector2D relativeResponseForce = wheel.calculateForce(relativeGroundSpeed, timeStep,prediction); Vector2D worldResponseForce = relativeToWorld(relativeResponseForce); applyForce(worldResponseForce, worldWheelOffset); } //no throttling yet this frame throttled = false; if(prediction) { super.updatePrediction(timeStep); } else { super.update(timeStep); } } @Override public void update(float timeStep) { doUpdate(timeStep,false); } public void updatePrediction(float timeStep) { doUpdate(timeStep,true); } public void inverseThrottle() { float scalar = 0.2f; for(Wheel wheel : wheels) { wheel.setTransmissionTorque(-wheel.getTransmissionTourque() * scalar); wheel.setWheelSpeed(-wheel.getWheelSpeed() * 0.1f); } } } And my big hack collision resolution: private void update() { camera.setPosition((vehicle.getPosition().x * camera.getScale()) - ((getWidth() ) / 2.0f), (vehicle.getPosition().y * camera.getScale()) - ((getHeight() ) / 2.0f)); //camera.move(input.getAnalogStick().getStickValueX() * 15.0f, input.getAnalogStick().getStickValueY() * 15.0f); if(input.isPressed(ControlButton.BUTTON_GAS)) { vehicle.setThrottle(1.0f, false); } if(input.isPressed(ControlButton.BUTTON_STEAL_CAR)) { vehicle.setThrottle(-1.0f, false); } if(input.isPressed(ControlButton.BUTTON_BRAKE)) { vehicle.setBrakes(1.0f); } vehicle.setSteering(input.getAnalogStick().getStickValueX()); //vehicle.update(16.6666666f / 1000.0f); boolean colided = false; vehicle.updatePrediction(16.66666f / 1000.0f); List<Entity> buildings = world.queryStaticSolid(vehicle,vehicle.getPredictionRect()); if(buildings.size() > 0) { colided = true; } if(!colided) { vehicle.update(16.66f / 1000.0f); } else { Vector2D delta = vehicle.getDeltaVec(); vehicle.setVelocity(Vector2D.negative(vehicle.getVelocity().multiply(0.2f)). add(delta.multiply(-1.0f))); vehicle.inverseThrottle(); } } Here is OBB public class OBB2D { // Corners of the box, where 0 is the lower left. private Vector2D corner[] = new Vector2D[4]; private Vector2D center = new Vector2D(); private Vector2D extents = new Vector2D(); private RectF boundingRect = new RectF(); private float angle; //Two edges of the box extended away from corner[0]. private Vector2D axis[] = new Vector2D[2]; private double origin[] = new double[2]; public OBB2D(Vector2D center, float w, float h, float angle) { set(center,w,h,angle); } public OBB2D(float left, float top, float width, float height) { set(new Vector2D(left + (width / 2), top + (height / 2)),width,height,0.0f); } public void set(Vector2D center,float w, float h,float angle) { Vector2D X = new Vector2D( (float)Math.cos(angle), (float)Math.sin(angle)); Vector2D Y = new Vector2D((float)-Math.sin(angle), (float)Math.cos(angle)); X = X.multiply( w / 2); Y = Y.multiply( h / 2); corner[0] = center.subtract(X).subtract(Y); corner[1] = center.add(X).subtract(Y); corner[2] = center.add(X).add(Y); corner[3] = center.subtract(X).add(Y); computeAxes(); extents.x = w / 2; extents.y = h / 2; computeDimensions(center,angle); } private void computeDimensions(Vector2D center,float angle) { this.center.x = center.x; this.center.y = center.y; this.angle = angle; boundingRect.left = Math.min(Math.min(corner[0].x, corner[3].x), Math.min(corner[1].x, corner[2].x)); boundingRect.top = Math.min(Math.min(corner[0].y, corner[1].y),Math.min(corner[2].y, corner[3].y)); boundingRect.right = Math.max(Math.max(corner[1].x, corner[2].x), Math.max(corner[0].x, corner[3].x)); boundingRect.bottom = Math.max(Math.max(corner[2].y, corner[3].y),Math.max(corner[0].y, corner[1].y)); } public void set(RectF rect) { set(new Vector2D(rect.centerX(),rect.centerY()),rect.width(),rect.height(),0.0f); } // Returns true if other overlaps one dimension of this. private boolean overlaps1Way(OBB2D other) { for (int a = 0; a < axis.length; ++a) { double t = other.corner[0].dot(axis[a]); // Find the extent of box 2 on axis a double tMin = t; double tMax = t; for (int c = 1; c < corner.length; ++c) { t = other.corner[c].dot(axis[a]); if (t < tMin) { tMin = t; } else if (t > tMax) { tMax = t; } } // We have to subtract off the origin // See if [tMin, tMax] intersects [0, 1] if ((tMin > 1 + origin[a]) || (tMax < origin[a])) { // There was no intersection along this dimension; // the boxes cannot possibly overlap. return false; } } // There was no dimension along which there is no intersection. // Therefore the boxes overlap. return true; } //Updates the axes after the corners move. Assumes the //corners actually form a rectangle. private void computeAxes() { axis[0] = corner[1].subtract(corner[0]); axis[1] = corner[3].subtract(corner[0]); // Make the length of each axis 1/edge length so we know any // dot product must be less than 1 to fall within the edge. for (int a = 0; a < axis.length; ++a) { axis[a] = axis[a].divide((axis[a].length() * axis[a].length())); origin[a] = corner[0].dot(axis[a]); } } public void moveTo(Vector2D center) { Vector2D centroid = (corner[0].add(corner[1]).add(corner[2]).add(corner[3])).divide(4.0f); Vector2D translation = center.subtract(centroid); for (int c = 0; c < 4; ++c) { corner[c] = corner[c].add(translation); } computeAxes(); computeDimensions(center,angle); } // Returns true if the intersection of the boxes is non-empty. public boolean overlaps(OBB2D other) { if(right() < other.left()) { return false; } if(bottom() < other.top()) { return false; } if(left() > other.right()) { return false; } if(top() > other.bottom()) { return false; } if(other.getAngle() == 0.0f && getAngle() == 0.0f) { return true; } return overlaps1Way(other) && other.overlaps1Way(this); } public Vector2D getCenter() { return center; } public float getWidth() { return extents.x * 2; } public float getHeight() { return extents.y * 2; } public void setAngle(float angle) { set(center,getWidth(),getHeight(),angle); } public float getAngle() { return angle; } public void setSize(float w,float h) { set(center,w,h,angle); } public float left() { return boundingRect.left; } public float right() { return boundingRect.right; } public float bottom() { return boundingRect.bottom; } public float top() { return boundingRect.top; } public RectF getBoundingRect() { return boundingRect; } public boolean overlaps(float left, float top, float right, float bottom) { if(right() < left) { return false; } if(bottom() < top) { return false; } if(left() > right) { return false; } if(top() > bottom) { return false; } return true; } }; What I do is when I predict a hit on the car, I force it back. It does not work that well and seems like a bad idea. What could I do to have more proper collision resolution. Such that if I hit a wall I will never get stuck in it and if I hit the side of a wall I can steer my way out of it. Thanks I found this nice ppt. It talks about pulling objects apart and calculating new velocities. How could I calc new velocities in my case? http://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CC8QFjAB&url=http%3A%2F%2Fcoitweb.uncc.edu%2F~tbarnes2%2FGameDesignFall05%2FSlides%2FCh4.2-CollDet.ppt&ei=x4ucULy5M6-N0QGRy4D4Cg&usg=AFQjCNG7FVDXWRdLv8_-T5qnFyYld53cTQ&cad=rja

    Read the article

  • 2D Game Help In XNA

    - by user22715
    I'm making a game in XNA called The Adventure Of The Very Hairy Princess Fairy. The game is a "Sidescroller/Platformer" like mario but there is a problem. How do I attack a wepon the the player texture and add animations so it looks like the player is holding the gun and It's not a floating image in front of the player? The player can kill with things like chainsaws playing as a very hairy princess fairy.

    Read the article

  • HowTo Enable jBullet DebugMode

    - by Kenneth Bray
    I would like to render the physics world of jBullet to debug some issues in my game, and I am not finding too much on enabling the debugDraw method of jBullet. Do I need to write my own debugDraw method, or is there an easier way to draw the physics models to the screen? If there is already a built in method I would prefer to use that, otherwise I guess I will start making my own functions to handle this.

    Read the article

  • Is it ok to initialize an RB_ConstraintActor in PostBeginPlay?

    - by Almo
    I have a KActorSpawnable subclass that acts weird. In PostBeginPlay, I initialize an RB_ConstraintActor; the default is not to allow rotation. If I create one in the editor, it's fine, and won't rotate. If I spawn one, it rotates. Here's the class: class QuadForceKActor extends KActorSpawnable placeable; var(Behavior) bool bConstrainRotation; var(Behavior) bool bConstrainX; var(Behavior) bool bConstrainY; var(Behavior) bool bConstrainZ; var RB_ConstraintActor PhysicsConstraintActor; simulated event PostBeginPlay() { Super.PostBeginPlay(); PhysicsConstraintActor = Spawn(class'RB_ConstraintActorSpawnable', self, '', Location, rot(0, 0, 0)); if(bConstrainRotation) { PhysicsConstraintActor.ConstraintSetup.bSwingLimited = true; PhysicsConstraintActor.ConstraintSetup.bTwistLimited = true; } SetLinearConstraints(bConstrainX, bConstrainY, bConstrainZ); PhysicsConstraintActor.InitConstraint(self, None); } function SetLinearConstraints(bool InConstrainX, bool InConstrainY, bool InConstrainZ) { if(InConstrainX) { PhysicsConstraintActor.ConstraintSetup.LinearXSetup.bLimited = 1; } else { PhysicsConstraintActor.ConstraintSetup.LinearXSetup.bLimited = 0; } if(InConstrainY) { PhysicsConstraintActor.ConstraintSetup.LinearYSetup.bLimited = 1; } else { PhysicsConstraintActor.ConstraintSetup.LinearYSetup.bLimited = 0; } if(InConstrainZ) { PhysicsConstraintActor.ConstraintSetup.LinearZSetup.bLimited = 1; } else { PhysicsConstraintActor.ConstraintSetup.LinearZSetup.bLimited = 0; } } DefaultProperties { bConstrainRotation=true bConstrainX=false bConstrainY=false bConstrainZ=false bSafeBaseIfAsleep=false bNoEncroachCheck=false } Here's the code I use to spawn one. It's a subclass of the one above, but it doesn't reference the constraint at all. local QuadForceKCreateBlock BlockActor; BlockActor = spawn(class'QuadForceKCreateBlock', none, 'PowerCreate_Block', BlockLocation(), m_PreparedRotation, , false); BlockActor.SetDuration(m_BlockDuration); BlockActor.StaticMeshComponent.SetNotifyRigidBodyCollision(true); BlockActor.StaticMeshComponent.ScriptRigidBodyCollisionThreshold = 0.001; BlockActor.StaticMeshComponent.SetStaticMesh(m_ValidCreationBlock.StaticMesh); BlockActor.StaticMeshComponent.AddImpulse(m_InitialVelocity); I used to initialize an RB_ConstraintActor where I spawned it from the outside. This worked, which is why I'm pretty sure it has nothing to do with the other code in QuadForceKCreateBlock. I then added the internal constraint in QuadForceKActor for other purposes. When I realized I had two constraints on the CreateBlock doing the same thing, I removed the constraint code from the place where I spawn it. Then it started rotating. Is there a reason I should not be initializing an RB_ConstraintActor in PostBeginPlay? I feel like there's some basic thing about how the engine works that I'm missing.

    Read the article

  • Collision Detection Game Design and Architecture

    - by Chompas
    I've reading some articles about collision detection. My question here is about ideas on the design for it. Baically I have a C++ game that has a main loop with entities with an update method. Based on keyboard input, these characters updates their positions. My question is not about how to detect collisions, it's about getting ideas in which is the best way to implement this. The game has a main character but also enemies that have to collide between them, so I'm not sure where to make all the iterations for checking collisions and if the right way is to check everything against everything. Thanks in advance.

    Read the article

  • How can I test if a point lies between two parallel lines?

    - by Harold
    In the game I'm designing there is a blast that shoots out from an origin point towards the direction of the mouse. The width of this blast is always going to be the same. Along the bottom of the screen (what's currently) squares move about which should be effected by the blast that the player controls. Currently I am trying to work out a way to discover if the corners of these squares are within the blast's two bounding lines. I thought the best way to do this would be to rotate the corners of the square around an origin point as if the blast were completely horizontal and see if the Y values of the corners were less than or equal to the width of the blast which would mean that they lie within the effected region, but I can't work out

    Read the article

  • What does a Game Designer do? what skills do they need?

    - by xenoterracide
    I know someone who is thinking about getting into game design, and I wondered, what does the job game designer entail? what tools do you have to learn how to use? what unique skills do you need? what exactly is it you'd do from day to day. I may be wording this a bit wrong because I'm not sure if the college program is become a game designer or learn game design. but I think the same questions apply either way.

    Read the article

  • Change the value of a dropdown if it is equal to something

    - by Jake Neal
    Sorry if this question has already been asked and answered, but I couldn't find anything specifically for my needs. I have a form that has placeholders and javascript to make sure the form isn't submitted with the placeholders still there. There is a dropdown box that has the value of 'Best time to call'. What I want to do is if this value is passed as the default, I want it to change to something like "n/a" or a blank value. I have achieved this with the comments box using the following javascript, but it doesn't seem to work the same for the dropdown: var comments=document.getElementById('comments').value; if (comments=="Comments") { document.getElementById('comments').value=""; } This isn't a required field so I can't have an alert come up, so I just need to value to be changed if submitted as 'Best time to call'. Hope I have explained everything correctly

    Read the article

  • UIActivityIndicatorView is not display at the right time

    - by Alexandre
    I'm making a form that allows the user to enter datas in my IOS application. This form allows the user to enter a lot of repetive datas. So, sometimes, the process takes time and I would like to display a UIActivityIndicatorView during this process. Unfortunalty the spinner appears only one second or less at the end of the process, not at the beginning as expected. There is some code : - (void) manageSpinner{ spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; [spinner setCenter:CGPointMake(self.view.bounds.size.width/2.0, self.view.bounds.size.height/2.0)]; // I do this becau I'm in landscape mode UIImageView *imageView = [[UIImageView alloc]initWithFrame:self.tableView.bounds]; UIImage *image = [UIImage imageNamed:@"dark_gradiant.jpg"]; [imageView setImage:image]; [imageView addSubview:spinner]; [self.tableView addSubview:imageView]; [spinner startAnimating]; } //On click save by the user - (IBAction)save:(id)sender{ //Collect information from the form myObject.name = nameTF.text; [...] if(informations OK[...]){ //Manage spinner [self manageSpinner]; //Add : this is the long process for (int i=0; i<nbRepeatChooseByUser; i++) { [myObject register]; } //Call the delegate that will dismiss the form [self.delegate theSaveButtonOnTheAddMyObjectTVCWasTapped:self]; } } The spinner is called before the adding method but it seems to be set up after the process. Thank you, Alexandre

    Read the article

  • cuda/thrust: Trying to sort_by_key 2.8GB of data in 6GB of gpu RAM throws bad_alloc

    - by Sven K
    I have just started using thrust and one of the biggest issues I have so far is that there seems to be no documentation as to how much memory operations require. So I am not sure why the code below is throwing bad_alloc when trying to sort (before the sorting I still have 50% of GPU memory available, and I have 70GB of RAM available on the CPU)--can anyone shed some light on this? #include <thrust/device_vector.h> #include <thrust/sort.h> #include <thrust/random.h> void initialize_data(thrust::device_vector<uint64_t>& data) { thrust::fill(data.begin(), data.end(), 10); } #define BUFFERS 3 int main(void) { size_t N = 120 * 1024 * 1024; char line[256]; try { std::cout << "device_vector" << std::endl; typedef thrust::device_vector<uint64_t> vec64_t; // Each buffer is 900MB vec64_t c[3] = {vec64_t(N), vec64_t(N), vec64_t(N)}; initialize_data(c[0]); initialize_data(c[1]); initialize_data(c[2]); std::cout << "initialize_data finished... Press enter"; std::cin.getline(line, 0); // nvidia-smi reports 48% memory usage at this point (2959MB of // 6143MB) std::cout << "sort_by_key col 0" << std::endl; // throws bad_alloc thrust::sort_by_key(c[0].begin(), c[0].end(), thrust::make_zip_iterator(thrust::make_tuple(c[1].begin(), c[2].begin()))); std::cout << "sort_by_key col 1" << std::endl; thrust::sort_by_key(c[1].begin(), c[1].end(), thrust::make_zip_iterator(thrust::make_tuple(c[0].begin(), c[2].begin()))); } catch(thrust::system_error &e) { std::cerr << "Error: " << e.what() << std::endl; exit(-1); } return 0; }

    Read the article

  • Space as grouping separator in printf

    - by blekione
    I know how to use comma in printf as grouping separator to print value in format like 1,000,000.00 to print it that way I'm using command System.out.printf ("%,.2f", value); but how to use space as grouping separator to format value like 1 000 000.00 I tried to find solution but solutions with using DecimalFormat look at now to complicate for me (beginner level). Is there as easy way as in example with comma to do it?

    Read the article

  • YII Mail Generate unwanted ascii character in HTML mail

    - by CedSha
    I use YII-Mail just by copying the sample but I always get some ascii charcters in my generated links Where they come from and how to avoid them ? $message = new YiiMailMessage; $message->view = 'mail'; $message->setBody(array('model'=>$model), 'text/html'); $message->subject = Yii::t('tr','my subject'); $message->addTo('[email protected]'); $message->from = '[email protected]'; Yii::app()->mail->send($message); and in view file 'mail' <h1><?php echo(Yii::t('tr','This is HTML mail')); ?></h1> <?php echo CHtml::link('Mylink', array('controller/view', 'id'=>$model->id)); ?> The resulted email source looks like this <h1>This is HTML mail</h1> <a href=3D"/testdrive/index.php?r=3D ....

    Read the article

  • block z-positioning without z-index

    - by Peter
    Please, have a look at: http://twitter.github.com/bootstrap/base-css.html There are many examples like this one: if you look closer to the block borders, you can see that the gray block is under the white one. Using the browser's developer tools you can see that both boxes have an inherited z-index: auto; I can't reproduce this effect on my website (without using z-index). So, my question is: Why is the gray block under the white one?

    Read the article

  • rewrite rule is not working in .htaccess file

    - by deepu sankar
    in my portal i call a pdf file, path looks like http://www.mysite.com/filespath/books/online_bliss_in_five_simple_steps_1339668056/live/online_dating_bliss_in_five_simple_steps_1339668056.php for user acceptance i need to reduce this url. then i add a code in .htaccess file. after adding this line only a white page is displaying when i call my portal the code is RewriteEngine On RewriteRule ^book/([A-Za-z0-9-]+_.)/?$ /live/$1.php [NC,L] please help me

    Read the article

  • how to use static function in header and compare with float array

    - by ed k
    I wrote this function: static bool colorIsEmpty(const Color col) { return (col[0] == 0 && col[1] == 0 && col[2] == 0 ); } where Color is simply a float[3]; the function doesn't work if col[3] are all 0; but this works: if(col[0] == col[1] == col[2] == 0) { //gets called } however gcc gives me warning: cColorTest.c:212:5: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] so it would be nice if that function works,why it doesn't work?

    Read the article

  • Why is Routes.rb not loading the IPs from cache?

    - by Christian Fazzini
    I am testing this in local. My ip is 127.0.0.1. The ip_permissions table, is empty. When I browse the site, everything works as expected. Now, I want to simulate browsing the site with a banned IP. So I add the IP into the ip_permissions table via: IpPermission.create!(:ip => '127.0.0.1', :note => 'foobar', :category => 'blacklist') In Rails console, I clear the cache via; Rails.cache.clear. I browse the site. I don't get sent to pages#blacklist. If I restart the server. And browse the site, then I get sent to pages#blacklist. Why do I need to restart the server every time the ip_permissions table is updated? Shouldn't it fetch it based on cache? Routes look like: class BlacklistConstraint def initialize @blacklist = IpPermission.blacklist end def matches?(request) @blacklist.map { |b| b.ip }.include? request.remote_ip end end Foobar::Application.routes.draw do match '/(*path)' => 'pages#blacklist', :constraints => BlacklistConstraint.new .... end My model looks like: class IpPermission < ActiveRecord::Base validates_presence_of :ip, :note, :category validates_uniqueness_of :ip, :scope => [:category] validates :category, :inclusion => { :in => ['whitelist', 'blacklist'] } def self.whitelist Rails.cache.fetch('whitelist', :expires_in => 1.month) { self.where(:category => 'whitelist').all } end def self.blacklist Rails.cache.fetch('blacklist', :expires_in => 1.month) { self.where(:category => 'blacklist').all } end end

    Read the article

  • How to find the insertion point in an array using binary search?

    - by ????
    The basic idea of binary search in an array is simple, but it might return an "approximate" index if the search fails to find the exact item. (we might sometimes get back an index for which the value is larger or smaller than the searched value). For looking for the exact insertion point, it seems that after we got the approximate location, we might need to "scan" to left or right for the exact insertion location, so that, say, in Ruby, we can do arr.insert(exact_index, value) I have the following solution, but the handling for the part when begin_index >= end_index is a bit messy. I wonder if a more elegant solution can be used? (this solution doesn't care to scan for multiple matches if an exact match is found, so the index returned for an exact match may point to any index that correspond to the value... but I think if they are all integers, we can always search for a - 1 after we know an exact match is found, to find the left boundary, or search for a + 1 for the right boundary.) My solution: DEBUGGING = true def binary_search_helper(arr, a, begin_index, end_index) middle_index = (begin_index + end_index) / 2 puts "a = #{a}, arr[middle_index] = #{arr[middle_index]}, " + "begin_index = #{begin_index}, end_index = #{end_index}, " + "middle_index = #{middle_index}" if DEBUGGING if arr[middle_index] == a return middle_index elsif begin_index >= end_index index = [begin_index, end_index].min return index if a < arr[index] && index >= 0 #careful because -1 means end of array index = [begin_index, end_index].max return index if a < arr[index] && index >= 0 return index + 1 elsif a > arr[middle_index] return binary_search_helper(arr, a, middle_index + 1, end_index) else return binary_search_helper(arr, a, begin_index, middle_index - 1) end end # for [1,3,5,7,9], searching for 6 will return index for 7 for insertion # if exact match is found, then return that index def binary_search(arr, a) puts "\nSearching for #{a} in #{arr}" if DEBUGGING return 0 if arr.empty? result = binary_search_helper(arr, a, 0, arr.length - 1) puts "the result is #{result}, the index for value #{arr[result].inspect}" if DEBUGGING return result end arr = [1,3,5,7,9] b = 6 arr.insert(binary_search(arr, b), b) p arr arr = [1,3,5,7,9,11] b = 6 arr.insert(binary_search(arr, b), b) p arr arr = [1,3,5,7,9] b = 60 arr.insert(binary_search(arr, b), b) p arr arr = [1,3,5,7,9,11] b = 60 arr.insert(binary_search(arr, b), b) p arr arr = [1,3,5,7,9] b = -60 arr.insert(binary_search(arr, b), b) p arr arr = [1,3,5,7,9,11] b = -60 arr.insert(binary_search(arr, b), b) p arr arr = [1] b = -60 arr.insert(binary_search(arr, b), b) p arr arr = [1] b = 60 arr.insert(binary_search(arr, b), b) p arr arr = [] b = 60 arr.insert(binary_search(arr, b), b) p arr and result: Searching for 6 in [1, 3, 5, 7, 9] a = 6, arr[middle_index] = 5, begin_index = 0, end_index = 4, middle_index = 2 a = 6, arr[middle_index] = 7, begin_index = 3, end_index = 4, middle_index = 3 a = 6, arr[middle_index] = 5, begin_index = 3, end_index = 2, middle_index = 2 the result is 3, the index for value 7 [1, 3, 5, 6, 7, 9] Searching for 6 in [1, 3, 5, 7, 9, 11] a = 6, arr[middle_index] = 5, begin_index = 0, end_index = 5, middle_index = 2 a = 6, arr[middle_index] = 9, begin_index = 3, end_index = 5, middle_index = 4 a = 6, arr[middle_index] = 7, begin_index = 3, end_index = 3, middle_index = 3 the result is 3, the index for value 7 [1, 3, 5, 6, 7, 9, 11] Searching for 60 in [1, 3, 5, 7, 9] a = 60, arr[middle_index] = 5, begin_index = 0, end_index = 4, middle_index = 2 a = 60, arr[middle_index] = 7, begin_index = 3, end_index = 4, middle_index = 3 a = 60, arr[middle_index] = 9, begin_index = 4, end_index = 4, middle_index = 4 the result is 5, the index for value nil [1, 3, 5, 7, 9, 60] Searching for 60 in [1, 3, 5, 7, 9, 11] a = 60, arr[middle_index] = 5, begin_index = 0, end_index = 5, middle_index = 2 a = 60, arr[middle_index] = 9, begin_index = 3, end_index = 5, middle_index = 4 a = 60, arr[middle_index] = 11, begin_index = 5, end_index = 5, middle_index = 5 the result is 6, the index for value nil [1, 3, 5, 7, 9, 11, 60] Searching for -60 in [1, 3, 5, 7, 9] a = -60, arr[middle_index] = 5, begin_index = 0, end_index = 4, middle_index = 2 a = -60, arr[middle_index] = 1, begin_index = 0, end_index = 1, middle_index = 0 a = -60, arr[middle_index] = 9, begin_index = 0, end_index = -1, middle_index = -1 the result is 0, the index for value 1 [-60, 1, 3, 5, 7, 9] Searching for -60 in [1, 3, 5, 7, 9, 11] a = -60, arr[middle_index] = 5, begin_index = 0, end_index = 5, middle_index = 2 a = -60, arr[middle_index] = 1, begin_index = 0, end_index = 1, middle_index = 0 a = -60, arr[middle_index] = 11, begin_index = 0, end_index = -1, middle_index = -1 the result is 0, the index for value 1 [-60, 1, 3, 5, 7, 9, 11] Searching for -60 in [1] a = -60, arr[middle_index] = 1, begin_index = 0, end_index = 0, middle_index = 0 the result is 0, the index for value 1 [-60, 1] Searching for 60 in [1] a = 60, arr[middle_index] = 1, begin_index = 0, end_index = 0, middle_index = 0 the result is 1, the index for value nil [1, 60] Searching for 60 in [] [60]

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >