Daily Archives

Articles indexed Thursday May 31 2012

Page 7/18 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • How to create a "shutdown user" or "shutdown account"

    - by pcapademic
    Red Hat had a feature useful to me at the present time. There was an account, generally called "shutdown", and when you logged in with the account, the system shut down. In my specific case, I have Ubuntu Server running in a VM on my local system. The VM is running a web app, and when I'm done doing work, I want to shut down the VM. Unfortunately, I can't install VMware tools to get the "power button" based shutdown. Currently I login then sudo shutdown -h now, then type my password again, and things shutdown. Really, it's getting annoying all that waiting around and typing things. How do I replicate the "shutdown account" functionality in Ubuntu? A related question, were there any security gotchas that motivated people to stop using this kind of account?

    Read the article

  • Login crash loop

    - by dawmail333
    After about the second/third batch of updates on a fresh install of Ubuntu 12.04, I end up getting stuck in an infinite login loop: I enter my password, screen goes black and shows me the end of the initialisation messages (including things like CUPS initialising), and then the greeter reappears. Kicker is, as I'm using gnome-shell, I just decided to uninstall LightDM, ubuntu-desktop and unity-greeter, using GDM as my manager, and the problem still happens in exactly the same manner. I'm lost even as to where to start looking - Xorg logs, LightDM logs (before I removed it), syslog and dmesg logs have held no unusual information at all. I have a TeX assignment due next week, and reinstalling Ubuntu every time I want to work on it is not going to work (nor is using TeX on Windows ;). Anything else I should try?

    Read the article

  • lubuntu issues with desktop directory

    - by Hongxu Chen
    My lubuntu 12.04 is upgraded from the 11.10 version and I'm a Chinese user. What surprises me is that the directory shown on the initial screen is always changing! recently It seems to be mapped with the directory called w in my home directory(~). However when using pcmanfm to open the directory it usually shows odd string as to the name of the folder that cannot be print, which I think may be some Chinese characters.The directory also sometimes fails to appear in the window appeared first when logged in. I know the lxde has no conception of the shown folder and I think the lubuntu team has done some optimization. Can someone tell me what's happening?Thanks in advance.

    Read the article

  • Disconnect have no effect using rdesktop

    - by Hongxu Chen
    So I'm using rdesktop with my labtop when I remote my PC in the lab,which is installed with Windows 7.Everything went well until I recently upgraded my lubuntu of the laptop(or maybe there's nothing with the upgrade at all,however I don't know).The rdesktop fails to disconnect when I disconnect from the start menu of Windows.This does not mean that I cannot return to my linux, actually I get back to lubuntu successfully and the terminal reports that I have disconnected.However when I re-login to Windows of the PC in the lab(via rdesktop) after I reboot my laptop, it fails.Then I come to the PC in the lab and the screen message tells me that it is still connected with my lubuntu. So what's the problem? Do any guys have similar experience? PC:Windows 7,in the lab;laptop:linux(lubuntu 12.04)

    Read the article

  • How do I add text to an animated .gif in gimp?

    - by Carla
    I have just worked out how to create an animated.gif in gimp but I am having a problem adding text. When I create/add the text box and then save my.gif and view it, the text only flashes up over one frame/layer. How do I make the text last over the entire duration of the animated.gif? If you could explain in very simple terms, with the easiest solution, that would be wonderful as I am quite new to all this and very unsure of what I am doing! Thank you for any help you can give.

    Read the article

  • Correct place to set $BIBINPUTS environment variable

    - by student
    If I set the $BIBINPUTS environment varibale in my .zshrc, it is recognized by emacs-reftex (via emacsclient), if I start emacs from my zsh commandline. However if I start using the menubar or gmrun it doesn't knot this variable. So where is the correct place to set for the whole user environment? If there are several alternatives, let me know. Also if it changed between differend ubuntu-versions. Edit: I have tried to set it in ~/.pam_environment like BSTINPUTS=.:/home/myuser/BiBTeX/:$BSTINPUTS BIBINPUTS=.:/home/myuser/BiBTeX/:$BIBINPUTS but it seems to have no effect (even after rebooting) and is not listed via printenv. I am currently using ubuntu natty + gdm + xmonad.

    Read the article

  • How to install a Lexmark z600 series printer?

    - by Uri Herrera
    It has been a headache trying to install this printer. All the tutorials I found are for older versions of Ubuntu, and none of them work. How can I install this printer? Edit: HOWTO: Install PITA Lexmark Z600 Z615 and Dell Photo Printer 720 Setup Lexmark Z600 and X series printer on Ubuntu (i tried this one, only that it was translated to spanish, but it was the same instructions) HOWTO: Lexmark Printers I always get an error when extracting the converted tars with all of the tuts, invalid argument or the file doesn't exist. Looks like, i was missing some ia32 libs .. and that caused the errors with the tar files, anyways i still can't print now i get this, cups-insecure-filter How to install Lezmark Z600 series printer Here, the OP offers 2 debs, i installed them on a 32 bit Ubuntu install, now the printer gets recognized but still can't print, 'cause i'm missing a filter, "rastertoz600".

    Read the article

  • Is it normal for 12.04 to occupy almost 4GB? Also, related questions

    - by Grant
    I'm using a ASUS EeePC 901 and have some basic questions/issues. I installed 12.04 on the 4GB drive, selecting the option to erase it before doing so. Immediately after the installation I saw that Update Manager had over 100 updates pending. I attempted to install these, but was told that I had less than 100 MB remaining. Does the OS occupy all the other space? It seems that the best solution is to install 12.04 on the 16GB drive. Is this true? If I do this, what is the best way to erase the 4GB drive afterwards?

    Read the article

  • How can I track a bug that caused a crash and was reported via apport / whoopsie?

    - by nealmcb
    It used to be that when a program crashed, especially when a user was using a pre-release of Ubuntu, apport could be used to open a bug report. The user could then track the bug, see if it affected others, help fix it, etc. As of Precise 12.04, this behavior and workflow changed. As I discovered in Bug #993450 “Apport fails to submit bug report”, by default apport no longer opens a bug report (and it is awkward but not impossible to get it to do so). At the same time people are noticing a new "whoopsie" process, as described at What is the 'whoopsie' process and what does it do?. After some more googling, I dug this blueprint up, which describes the whole process: ErrorTracker - Ubuntu Wiki. (It didn't mention whoopsie or daisy, so I added them - please correct me if I got it wrong). Wow - this sounds like great work to streamline and improve the crash reporting process. I'm left with this question: how does a user learn what the status of the problem is? The blueprint now has this requirement The user should have some way to check back on the status of their crash report; e.g. have some report ID they can look at to see statistics and/or any associated bug #. E.g. provide a serial number at time of filing that they can load via a web page later on. which seems unimplemented. Is there anything available in the meantime? And how does a developer get into the game? Going to https://daisy.ubuntu.com just provides an "Incorrect Content-Type" error message. Finally, I suggest documenting the apport behavior changes in the Release Notes. It should be of interest to anyone who has been trying to help out Ubuntu.

    Read the article

  • sysctl.conf ignore net settings

    - by Steffen Unland
    I have a little problem with sysctl on a Ubuntu 10.04 LTS system. When I set the sysctl values with "sysctl -w " all work fine, but when I try to use the sysctl.conf file. the net settings will be ignored. For example my sysctl.conf # /etc/sysctl.conf - Configuration file for setting system variables kernel.domainname=findme.sysctl # Corefiles information fs.suid_dumpable=2 kernel.core_pattern=/cores/core-%e-%s-%u-%g-%p-%t ##############################################################3 # Functions previously found in netbase net.ipv4.netfilter.ip_conntrack_tcp_timeout_fin_wait=1 net.ipv4.netfilter.ip_conntrack_tcp_timeout_close_wait=1 when I grep to the values, I can see that the sysctl settings for net.ipv4.netfilter don't set. [host:~ ] $ sysctl -a | grep domainname kernel.domainname = findme.sysctl [host:~ ] $ sysctl -a | grep "core_pattern" kernel.core_pattern = /cores/core-%e-%s-%u-%g-%p-%t [host:~ ] $ sysctl -a | grep "timeout_fin_wait" net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 120 net.ipv4.netfilter.ip_conntrack_tcp_timeout_fin_wait = 120 [host:~ ] $ sysctl -a | grep "timeout_close_wait" net.netfilter.nf_conntrack_tcp_timeout_close_wait = 60 net.ipv4.netfilter.ip_conntrack_tcp_timeout_close_wait = 60 can somebody help me to solve the problem? If you need more information I can post it. Cheers, Steffen

    Read the article

  • find . -type l says missing argument

    - by Sebi
    I want to find all symbolic links in the current directory and below. Therefore, I used: find . -type l Running that clears the screen showing "Pattern not found (press RETURN)" at the bottom of the screen. After pressing return, I get: find: missing argument to `-type' Here some system details: Ubuntu 10.04 LTS 64Bit zsh 4.3.10 (x86_64-unknown-linux-gnu) happens also in Screen version 4.00.03jw4 (FAU) 2-May-06 find (GNU findutils) 4.4.2 So how do I search for symbolic links so that I can grep in their names?

    Read the article

  • Grub Won't Boot WIndows 7

    - by STavros P.
    I have a problem with Grub 2. when i hit the Windows 7 (loader) option on the Grub boot screen Windows won't boot. i get a black screen with a white cursor blinking... Here is a log of my Boot options. I just want to delete all the other partitions which i don't know how they 've been made and stay just with the Ubuntu ext4 partition, the swap partition and the WIndows 7 partition. Can someoune help me with my problem? Here is the log: http://paste.ubuntu.com/1014619/ ps: I can only boot Windows with Hiren's Boot CD with the first option, Boot form first hard drive (win7, xp, vista).

    Read the article

  • OpenStack + Ubuntu 12.04

    - by csgeek
    Supposedly openstack can be installed easily under Ubuntu 12.04 LTS. I've installed 32 and 64bit versions of Ubuntu Server with the same behavior. sudo tasksel check OpenStack hit Okay then I get a tasksel: aptitude failed (100) I've seen: http://www.hastexo.com/resources/docs/installing-openstack-essex-20121-ubuntu-1204-precise-pangolin and https://github.com/EmilienM/doc-openstack documentation, but I was hoping that since it was an LTS released and it was an option in tasksel that I was simply overlooking something obvious and it's just a matter of selecting the right checkbox and hitting okay. Too much wishful thinking?

    Read the article

  • Is it legal to ask photo ID and credit card copy in the U.S

    - by selim
    I regularly order from online shops around the world and I have not see any case where the company asks for photo ID or credit card copy. Yesterday I make an order from linode.com and my order is on hold because of their "fraud check system". Is it common to ask those info in U.S. where I have never asked such info in here (Istanbul, Turkey). And I already asked what is their motive and legal stand and the reason my order is hold by their fraud system. And I also added whether is because I live in Istanbul, Turkey. Their answer was as following: "We would not be able to disclose specific information related to our fraud system." And I'm asked repeatedly whether I want to cancel my order or not. I dont questioning reputation of linode.com if I think so, I did not make an order. I think asking for photo ID is neither legal nor provide any security.

    Read the article

  • Appropriate response when client empowered with CMS destroys content to his own will

    - by dukeofgaming
    So, I just recently closed a website project that pretty much was The Oatmeals' Design Hell, but with content. The client loved the site at the beginning but started getting other people involved and mercilessly bombarding us with their opinions. We served a carefully thought content strategy (which the client approved) and extremely curated copywriting that took us four months after at least 5 requirement changes (new content, new objectives for the business, changed offerings, new mindfaps, etc.) that required us to rewrite the content about 3 times. The client never gave timely feedback even though we kept the process open for him and his people to see (content being developed transparently in Google Docs). Near the end of the project he still wanted to make changes but wanted us to finish already (there are not enough words in the world to even try to make sense of this). So I explained to him the obvious implications of the never-ending requirement changes and advised him to take the time to gather his thoughts with his own team and see the new content introduced as a new content maintenance project. He happily accepted, but on the day of training/delivery things went very wrong and we have no idea why. The client didn't even allow the site to be out for a week with the content we developed for him and quickly replaced us with a Joomla savvy intern so that he completely destroy the content with shallow, unstructured, tasteless and plain wordsmithing (and I'm not even being visceral). Worst insult of all, he revoked our access from his server and the deployed CMS not even having passed 10 minutes of being given his administrator account (we realized the day after that he did it in our own office, the nerve!). Everybody involved in the team is enraged and insulted. I never want to see this happen again. So, to try to make sense of this situation and avoid it in the future with new clients I have two concrete questions: Is there even an appropriate course of action with a client like this?, or is he just not worth the trouble of analyzing (blindly hoping this never repeats again). In the exercise to try and blame ourselves instead of the client and take this as a lesson of... something, how should we set expectations for new clients about the working terms, process and final product so that they are discouraged from mauling the content to their own contempt once they get the codes to the nukes (access to the CMS)?

    Read the article

  • How to submit sitemap when your website has partial https? - Error: "Not in Domain"

    - by Ralph N
    My website is an ecommerce that is set up to do http for the item browsing portion, but https for things like shopping cart, contact us, etc.. (anything that has forms on it). I've submitted my website a long time ago to google webmaster tools as http://www.mywebsite.com. I also submitted a sitemap with about 40 links - 8 of them are https. I've noticed that for the longest time, google webmaster tools was reporting that 32 out of the 40 links have been crawled. I tested all the links against my robots.txt and realized that my robots text was blocking the https links. Google says those links are "Not In Domain". Is there a way i'm supposed to get around this so that I can have a hybrid-ssl site? I understand the concept that one site is mywebsite.com:80 and the other is mywebsite.com:443, but i'd like to avoid submitting and maintaining 2 seperate websites on google webmaster tools.

    Read the article

  • 301 redirects in main navigation menu of WordPress website - is this okay for SEO?

    - by Lewis Bassett
    I want to allow a client to have a flexible way to configure the navigation menu for his WordPress website. To that end, I have created a parent page called "Navigation", which has child pages for each page to be displayed in the navigation menu. Those pages then get 301 redirected to the actual page that should be served. This means the client can create pages freely, and then set up redirects for them as and when needed. This is a really easy way for him to manage his main menu and it works well. From an SEO point of view, is this okay? Will the pages be indexed fine?

    Read the article

  • A simple message room

    - by webbyJoe
    Can anyone recommend a simple message room (not chat room) which I can use for a private communication between my users. My idea: to grant some users (2-3 at the most) a specific privilege to talk privately in a message room. none of them would be administrator there. I need such features: - admin panel for adding users allowed to post messages in room - room invisible to anyone except users - filtering not-allowed words - Ajax-enabled so that replies appear immediately - other message room features I have a linux hosting so PHP message room would be the best option. I thought of using a forum for this, but it's too much work as a forum is public by nature and I need something private by nature. Any ideas? Thanks in advance.

    Read the article

  • A frequently updated mixed bag blog OR several seldom updated niche sites?

    - by Melanie
    Background I am a member of the website HubPages where I have about a hundred articles (and I'm always writing more.) Anyway, HubPages revenue model is 40% ad-share for them and 60% ad share for users. While the userbase there is really friendly, the site is REALLY slow, buggy and there is a ton of content on HubPages that is copied from other sources. Upon flagging these articles it takes a ton of time for mods to remove it and it's just generally dragging down my stuff. Furthermore, HubPages was hit really hard by Google's Panda Update: http://www.google.com/search?hl=en&rlz=1B3GGLL_enUS426US426&tbm=nws&q=google+panda& Aside from the temporary problems I would deal with when removing content from HubPages and putting it on my own domain (duplicate content, etc) I have another problem. Which would be the best for my articles? I have tons of articles in a wide variety of niches and would like to do what would help them perform the best. I'm not a huge niche writer and have received wide criticism from the HubPages community for my articles not performing as well as they could because I don't use enough keywords within the text of my articles. I prefer to write more naturally in a way that would appeal to an audience instead of keyword stuff. Anyway, this is aside the point. My Question After removing my articles from HubPages, should I put them on one domain or spread them across multiple domains grouped sort of by topic. For example: a-bunch-of-articles.com OR travel-articles.com and financial-articles.com and knitting-articles.com (I know those domains aren't available, but it's just kind of an example.) Here are the pros and cons of each: a mixed bag site like a-bunch-of-articles.com may not perform as well because of its mixed-bag nature a mixed bag site would be updated far more frequently than several niche sites... some niche sites may be updated so infrequently that a year could pass before one sees a new article a mixed bag site would be like putting all my eggs is one basket, where having several niche sites would spread out my portfolio, so to speak. a mixed bag site would be cheaper, $14 (two year registration) to start out with and hosting and I'm good to go. a mixed bag site wouldn't allow me to easily target keywords, but then again isn't HubPages pretty much a mixed bag site?

    Read the article

  • Triangles in a C++ STL Vector as an Objective-C member sometimes draws incorrectly in OpenGL ES

    - by Rahil627
    The polygons draw correctly 80% of the time. When it fails, a vertex is dislocated. The polygon is consistently drawn with the wrong vertex. I checked that the vector is correct during initialization, even when it's wrongly drawn. I'm using Cocos2d. The class member: @interface Polygon : CCSprite { std::vector<float> triangleVertices; } The draw function called in [Polygon draw]: + (void)drawTrianglesWithVertices:(const std::vector<float> &)v { //glEnableClientState(GL_VERTEX_ARRAY); glDisable(GL_TEXTURE_2D); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_COLOR_ARRAY); glVertexPointer(2, GL_FLOAT, 0, &v[0]); glDrawArrays(GL_TRIANGLES, 0, v.size()); //glDisableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_TEXTURE_2D); } Any ideas?

    Read the article

  • Jitter during wall collisions with Bullet Physics: contact/penetration tolerance?

    - by Niriel
    I use the bullet physics engine through Panda3d. My scene is still very simple, think 'Wolfenstein3d': tile-based, walls are solid cubes. I expect walls to block the player, and I expect the player to slide along the walls in case of non-normal incidence. What I get is what I expect, with one difference: there is some jitter. If I try to force myself into the wall, then I see the frames blinking quickly between two positions. These differ by about 0.04 units of distance, which corresponds to 4 cm in my game. I noticed a 4 cm elsewhere: the bottom of my player capsule is 4 cm below ground, when at rest. Does that mean that there is somewhere in the Bullet engine a default 0.04-units-long tolerance to differentiate contact from collision? If so, what should I do ? Should I change the scale of my game so that these 0.04 units correspond to 0.4 cm, making the jitter ten times smaller? Or can I ask bullet to change its tolerance to a smaller value? Edit This is the jitter I get: 6.155 - 6.118 = 0.036 LPoint3f(0, 6.11694, 0.835) LPoint3f(0, 6.15499, 0.835) LPoint3f(0, 6.11802, 0.835) LPoint3f(0, 6.15545, 0.835) LPoint3f(0, 6.11817, 0.835) LPoint3f(0, 6.15726, 0.835) LPoint3f(0, 6.11876, 0.835) LPoint3f(0, 6.15911, 0.835) LPoint3f(0, 6.11937, 0.835) I found a setMargin method. I set it to 5 mm both on the BoxShape for the walls and on the Capsule shape for the player. It still jitters by about 35 mm as illustrated by this log (11.117 - 11.082 = 0.035): LPoint3f(0, 11.0821, 0.905) LPoint3f(0, 11.1169, 0.905) LPoint3f(0, 11.082, 0.905) LPoint3f(0, 11.117, 0.905) LPoint3f(0, 11.082, 0.905) LPoint3f(0, 11.117, 0.905) LPoint3f(0, 11.0821, 0.905) LPoint3f(0, 11.1175, 0.905) LPoint3f(0, 11.0822, 0.905) LPoint3f(0, 11.1178, 0.905) LPoint3f(0, 11.0823, 0.905) LPoint3f(0, 11.1183, 0.905) The margin on the capsule did change my penetration with the floor though, I'm a bit higher (0.905 instead of 0.835). However, it did not change anything when colliding with the walls. How can I make the collisions against the walls less jittery? Edit, the day after: After more investigation, it appears that dynamic objects behave well. My problem comes from the btKinematicCharacterController that I use for moving my character; that stuff is totally bugged, according to the whole Internet :/.

    Read the article

  • Text based game in XNA

    - by Sigh-AniDe
    I want to create a text based game, where the player will type up,down, left or right and the sprite will move in that direction. I created the game and at the moment the player moves with the up,left,down and right keys. I would like to change the movement of the sprite from keypresses to text commands, Ive googled a lot on creating text based games in XNA but have had no luck. Could you please help me or guide me in the right direction of how to do this in XNA. All help will greatly be appreciated. Thanks

    Read the article

  • Cocos2D - Detecting collision

    - by Grace
    I am a beginner in cocos2d and im facing a problem with detecting collision for my coins. Sometimes it works sometimes it doesn't. So basically, im creating a game which the user (ship) have to avoid the obstacles and collect coins on the way. The collision of the obstacle works well but not for the coins. I was thinking maybe the loops for creating many coins is the problem but im not sure. Can anyone help? My codes: - (void)update:(ccTime)dt{ double curTime = CACurrentMediaTime(); if (curTime > _nextBridgeSpawn) { float randSecs = [self randomValueBetween:3.0 andValue:5.0]; _nextBridgeSpawn = randSecs + curTime; float randX = [self randomValueBetween:50 andValue:500]; float randDuration = [self randomValueBetween:8.0 andValue:10.0]; CCSprite *bridge = [_bridge objectAtIndex:_nextBridge]; _nextBridge++; if (_nextBridge >= _bridge.count) _nextBridge = 0; [bridge stopAllActions]; bridge.position = ccp(winSize.width/2, winSize.height); bridge.visible = YES; [bridge runAction:[CCSequence actions: [CCMoveBy actionWithDuration:randDuration position:ccp(0, -winSize.height)], [CCCallFuncN actionWithTarget:self selector:@selector(setInvisible:)], nil]]; this is where i declare my coins (continued from the update method) int randCoin = [self randomValueBetween:0 andValue:5]; _coin = [[CCArray alloc] initWithCapacity:randCoin]; for(int i = 0; i < randCoin; ++i) { coin = [CCSprite spriteWithFile:@"coin.png"]; coin.visible = NO; [self addChild:coin]; [_coin addObject:coin]; } float randCoinX = [self randomValueBetween:winSize.width/5 andValue:winSize.width - (border.contentSize.width *2)]; float randCoinY = [self randomValueBetween:100 andValue:700]; float randCoinPlace = [self randomValueBetween:30 andValue:60]; for (int i = 0; i < _coin.count; ++i) { CCSprite *coin2 = [_coin objectAtIndex:i]; coin2.position = ccp(randCoinX, (bridge.position.y + randCoinY) + (randCoinPlace *i)); coin2.visible = YES; [coin2 runAction:[CCSequence actions: [CCMoveBy actionWithDuration:randDuration position:ccp(0, -winSize.height-2000)], [CCCallFuncN actionWithTarget:self selector:@selector(setInvisible:)], nil]]; } } this is to check for collision (also in the update method) for (CCSprite *bridge in _bridge) { if (!bridge.visible) continue; if (CGRectIntersectsRect(ship.boundingBox, bridge.boundingBox)){ bridge.visible = NO; [ship runAction:[CCBlink actionWithDuration:1.0 blinks:5]]; } } } //this is the collision for coins which only work at times for (CCSprite *coin2 in _coin) { if (!coin2.visible) continue; if (CGRectIntersectsRect(ship.boundingBox, coin2.boundingBox)) { NSLog(@"Coin collected"); coin2.visible = NO; } } } Thank you.

    Read the article

  • Sliding collision response

    - by dbostream
    I have been reading plenty of tutorials about sliding collision responses yet I am not able to implement it properly in my project. What I want to do is make a puck slide along the rounded corner boards of a hockey rink. In my latest attempt the puck does slide along the boards but there are some strange velocity behaviors. First of all the puck slows down a lot pretty much right away and then it slides for awhile and stops before exiting the corner. Even if I double the speed I get a similar behavior and the puck does not make it out of the corner. I used some ideas from this document http://www.peroxide.dk/papers/collision/collision.pdf. This is what I have: Update method called from the game loop when it is time to update the puck (I removed some irrelevant parts). I use two states (current, previous) which are used to interpolate the position during rendering. public override void Update(double fixedTimeStep) { /* Acceleration is set to 0 for now. */ Acceleration.Zero(); PreviousState = CurrentState; _collisionRecursionDepth = 0; CurrentState.Position = SlidingCollision(CurrentState.Position, CurrentState.Velocity * fixedTimeStep + 0.5 * Acceleration * fixedTimeStep * fixedTimeStep); /* Should not this be affected by a sliding collision? and not only the position. */ CurrentState.Velocity = CurrentState.Velocity + Acceleration * fixedTimeStep; Heading = Vector2.NormalizeRet(CurrentState.Velocity); } private Vector2 SlidingCollision(Vector2 position, Vector2 velocity) { if(_collisionRecursionDepth > 5) return position; bool collisionFound = false; Vector2 futurePosition = position + velocity; Vector2 intersectionPoint = new Vector2(); Vector2 intersectionPointNormal = new Vector2(); /* I did not include the collision detection code, if a collision is detected the intersection point and normal in that point is returned. */ if(!collisionFound) return futurePosition; /* If no collision was detected it is safe to move to the future position. */ /* It is not exactly the intersection point, but slightly before. */ Vector2 newPosition = intersectionPoint; /* oldVelocity is set to the distance from the newPosition(intersection point) to the position it had moved to had it not collided. */ Vector2 oldVelocity = futurePosition - newPosition; /* Project the distance left to move along the intersection normal. */ Vector2 newVelocity = oldVelocity - intersectionPointNormal * oldVelocity.DotProduct(intersectionPointNormal); if(newVelocity.LengthSq() < 0.001) return newPosition; /* If almost no speed, no need to continue. */ _collisionRecursionDepth++; return SlidingCollision(newPosition, newVelocity); } What am I doing wrong with the velocity? I have been staring at this for very long so I have gone blind. I have tried different values of recursion depth but it does not seem to make it better. Let me know if you need more information. I appreciate any help. EDIT: A combination of Patrick Hughes' and teodron's answers solved the velocity problem (I think), thanks a lot! This is the new code: I decided to use a separate recursion method now too since I don't want to recalculate the acceleration in each recursion. public override void Update(double fixedTimeStep) { Acceleration.Zero();// = CalculateAcceleration(fixedTimeStep); PreviousState = new MovingEntityState(CurrentState.Position, CurrentState.Velocity); CurrentState = SlidingCollision(CurrentState, fixedTimeStep); Heading = Vector2.NormalizeRet(CurrentState.Velocity); } private MovingEntityState SlidingCollision(MovingEntityState state, double timeStep) { bool collisionFound = false; /* Calculate the next position given no detected collision. */ Vector2 futurePosition = state.Position + state.Velocity * timeStep; Vector2 intersectionPoint = new Vector2(); Vector2 intersectionPointNormal = new Vector2(); /* I did not include the collision detection code, if a collision is detected the intersection point and normal in that point is returned. */ /* If no collision was detected it is safe to move to the future position. */ if (!collisionFound) return new MovingEntityState(futurePosition, state.Velocity); /* Set new position to the intersection point (slightly before). */ Vector2 newPosition = intersectionPoint; /* Project the new velocity along the intersection normal. */ Vector2 newVelocity = state.Velocity - 1.90 * intersectionPointNormal * state.Velocity.DotProduct(intersectionPointNormal); /* Calculate the time of collision. */ double timeOfCollision = Math.Sqrt((newPosition - state.Position).LengthSq() / (futurePosition - state.Position).LengthSq()); /* Calculate new time step, remaining time of full step after the collision * current time step. */ double newTimeStep = timeStep * (1 - timeOfCollision); return SlidingCollision(new MovingEntityState(newPosition, newVelocity), newTimeStep); } Even though the code above seems to slide the puck correctly please have a look at it. I have a few questions, if I don't multiply by 1.90 in the newVelocity calculation it doesn't work (I get a stack overflow when the puck enters the corner because the timeStep decreases very slowly - a collision is found early in every recursion), why is that? what does 1.90 really do and why 1.90? Also I have a new problem, the puck does not move parallell to the short side after exiting the curve; to be more exact it moves outside the rink (I am not checking for any collisions with the short side at the moment). When I perform the collision detection I first check that the puck is in the correct quadrant. For example bottom-right corner is quadrant four i.e. circleCenter.X < puck.X && circleCenter.Y puck.Y is this a problem? or should the short side of the rink be the one to make the puck go parallell to it and not the last collision in the corner? EDIT2: This is the code I use for collision detection, maybe it has something to do with the fact that I can't make the puck slide (-1.0) but only reflect (-2.0): /* Point is the current position (not the predicted one) and quadrant is 4 for the bottom-right corner for example. */ if (GeometryHelper.PointInCircleQuadrant(circleCenter, circleRadius, state.Position, quadrant)) { /* The line is: from = state.Position, to = futurePosition. So a collision is detected when from is inside the circle and to is outside. */ if (GeometryHelper.LineCircleIntersection2d(state.Position, futurePosition, circleCenter, circleRadius, intersectionPoint, quadrant)) { collisionFound = true; /* Set the intersection point to slightly before the real intersection point (I read somewhere this was good to do because of floting point precision, not sure exactly how much though). */ intersectionPoint = intersectionPoint - Vector2.NormalizeRet(state.Velocity) * 0.001; /* Normal at the intersection point. */ intersectionPointNormal = Vector2.NormalizeRet(circleCenter - intersectionPoint) } } When I set the intersection point, if I for example use 0.1 instead of 0.001 the puck travels further before it gets stuck, but for all values I have tried (including 0 - the real intersection point) it gets stuck somewhere (but I necessarily not get a stack overflow). Can something in this part be the cause of my problem? I can see why I get the stack overflow when using -1.0 when calculating the new velocity vector; but not how to solve it. I traced the time steps used in the recursion (initial time step is always 1/60 ~ 0.01666): Recursion depth Time step next recursive call [Start recursion, time step ~ 0.016666] 0 0,000985806527246773 [No collision, stop recursion] [Start recursion, time step ~ 0.016666] 0 0,0149596704364629 1 0,0144883449376379 2 0,0143155612984837 3 0,014224925727213 4 0,0141673917461608 5 0,0141265435314026 6 0,0140953966184117 7 0,0140704653746625 ...and so on. As you can see the collision is detected early in every recursive call which means the next time step decreases very slowly thus the recursion depth gets very big - stack overflow.

    Read the article

  • Client side prediction/simulation Question

    - by Legendre
    I found a related question but it doesn't have what I needed. Client A sends input to move at T0. Server receives input at T1. All clients receive the change at T2. Question: With client-side prediction, client A would start moving at T0, client-side. All other clients receive the change at T2, so to them, client A only started moving at T2. If I understand correctly, client B will always see client A's past position and not his current position? How do I sync both client B and client A?

    Read the article

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